Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultMigrationsTableName = "_migrations"
Variables ¶
View Source
var ( ErrMissingDatabaseName = errors.New("missing database name") ErrFailedToGetAffectedRows = errors.New("failed getting the number of affected rows") )
View Source
var (
ErrDriverNotFound = errors.New("driver not found")
)
Functions ¶
func Register ¶
func Register(name string, constructor DriverConstructor)
Register will register a new driver constructor for the given driver name.
Types ¶
type DBWithDriver ¶
type Driver ¶
type Driver interface {
Add(ctx context.Context, id string) error
Remove(ctx context.Context, id string) error
StartMigration(ctx context.Context, id string) error
FinishMigration(ctx context.Context, id string) error
Lock(ctx context.Context) (migrations.Unlocker, error)
}
func DriverFromDB ¶
func DriverFromDB(db DBWithDriver, options ...Option) (Driver, error)
Click to show internal directories.
Click to hide internal directories.