Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMigrator = xerrors.Message("migrator")
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { List(ctx context.Context) ([]int, error) Migrate(ctx context.Context, actions []Action) error }
Database is the interface for the database on which the migrations will be executed.
type FilesystemProvider ¶
type FilesystemProvider struct {
// contains filtered or unexported fields
}
func NewFilesystemProvider ¶
func NewFilesystemProvider(fs FS, path string) *FilesystemProvider
type Migration ¶
type Migration interface { Version(ctx context.Context) int Up(ctx context.Context) (string, error) Down(ctx context.Context) (string, error) Snapshot(ctx context.Context) (string, error) }
Migration represent a single migration that can be executed.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func (*Migrator) CurrentVersion ¶
CurrentVersion returns latest applied migration version.
func (*Migrator) LatestVersion ¶
LatestVersion returns latest available migration version.
type SQLDatabase ¶
type SQLDatabase struct {
// contains filtered or unexported fields
}
func NewSQLDatabase ¶
func NewSQLDatabase(sqldb sqldb) *SQLDatabase
Click to show internal directories.
Click to hide internal directories.