Documentation ¶
Index ¶
- Constants
- Variables
- func Down(ctx context.Context, tx *sqlx.Tx, migs []Migration) error
- func SetVersion(ctx context.Context, tx *sqlx.Tx, version int64, dirty bool) error
- func Up(ctx context.Context, tx *sqlx.Tx, migs []Migration) error
- func Version(ctx context.Context, tx *sqlx.Tx) (version int64, dirty bool, err error)
- type ErrDirty
- type ErrMigration
- type MigFields
- type Migration
- type MultiError
Constants ¶
View Source
const (
NilVersion = -1
)
Variables ¶
View Source
var ( // use same migration table name as mattes/migrate, so that we don't have to // migrate that. // TODO doesn't have to be a glob MigrationsTable = "schema_migrations" ErrLocked = errors.New("database is locked") )
Functions ¶
func SetVersion ¶
Types ¶
type ErrMigration ¶
type ErrMigration string
ErrMigration represents an error running a specific migration in a specific direction
func (ErrMigration) Error ¶
func (e ErrMigration) Error() string
type MigFields ¶
type MigFields struct { UpFunc func(context.Context, *sqlx.Tx) error DownFunc func(context.Context, *sqlx.Tx) error VersionFunc func() int64 }
MigFields implements Migration and can be used for convenience.
type MultiError ¶
type MultiError struct {
Errs []error
}
MultiError holds multiple errors. If you have to handle one of these... I am so sorry.
func (MultiError) Error ¶
func (m MultiError) Error() string
Click to show internal directories.
Click to hide internal directories.