dbschema

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChangeLogTableName     = "dbschema_changelog"
	DefaultChangeLogLockTableName = "dbschema_changelog_lock"
)
View Source
const (
	ColumnChangeSetId     = "changeset_id"
	ColumnChangeSetName   = "changeset_name"
	ColumnChangeSetAuthor = "changeset_author"
	ColumnExecutedAt      = "executed_at"
	ColumnUpdatedAt       = "updated_at"
	ColumnOrderExecuted   = "order_executed"
	ColumnSha256Sum       = "sha256_sum"
	ColumnTags            = "tags"
	ColumnVersion         = "dbschema_version"
)

Constants for change log column names.

View Source
const (
	ColumnLockId   = "lock_id"
	ColumnIsLocked = "is_locked"
	ColumnLockedAt = "locked_at"
	ColumnLockedBy = "locked_by"
)

Constants for change log lock column names.

View Source
const DefaultLockId = "LOCK"
View Source
const DefaultTimeFormat = time.RFC1123Z
View Source
const Version = "v0.0.0-alpha"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppliedChangeSet

type AppliedChangeSet struct {
	Id            string
	Name          *string
	Author        *string
	ExecutedAt    time.Time
	UpdatedAt     time.Time
	OrderExecuted int
	Sha256Sum     string
	Tags          []string
	Version       string
}

func (*AppliedChangeSet) String

func (acs *AppliedChangeSet) String() string

func (*AppliedChangeSet) StringVerbose

func (acs *AppliedChangeSet) StringVerbose() string

type DB

type DB interface {
	Ping() error
	Begin() (Tx, error)
	io.Closer
}

type DBSchema

type DBSchema struct {
	dialect.Dialect
	// contains filtered or unexported fields
}

func Open

func Open(dialect dialect.Dialect, conn string, changeLog *refactor.ChangeLog) (*DBSchema, error)

func (*DBSchema) Close

func (d *DBSchema) Close() error

func (*DBSchema) Down

func (d *DBSchema) Down(logger logger.Logger, count int) error

func (*DBSchema) Expand

func (d *DBSchema) Expand(expr string) (value string, err error)

func (*DBSchema) Status

func (d *DBSchema) Status(logger logger.Logger) error

func (*DBSchema) Up

func (d *DBSchema) Up(logger logger.Logger, count int) error

type Execer

type Execer interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
}

type ParsingTagsError

type ParsingTagsError struct {
	Tags string
	Err  error
}

func (*ParsingTagsError) Error

func (e *ParsingTagsError) Error() string

type QueryExecer

type QueryExecer interface {
	Queryer
	Execer
}

type Queryer

type Queryer interface {
	Query(query string, args ...interface{}) (Rows, error)
	QueryRow(query string, args ...interface{}) Row
}

type Row

type Row interface {
	Scanner
}

type Rows

type Rows interface {
	io.Closer
	Next() bool
	Columns() ([]string, error)
	Err() error
	Scanner
}

type Scanner

type Scanner interface {
	Scan(dest ...interface{}) error
}

type Tx

type Tx interface {
	QueryExecer
	Rollback() error
	Commit() error
}

type UnsupportedDialectError

type UnsupportedDialectError string

func (UnsupportedDialectError) Error

func (e UnsupportedDialectError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL