Documentation
¶
Overview ¶
Package migrator provides PostgreSQL migration execution APIs backed by pgx.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultXMigrationsTable = "schema_migrations" DefaultSource = "file://desc/sql_migration" )
Functions ¶
func WithSourceAppendDriver ¶
Types ¶
type Migrator ¶
type Migrator interface {
// Up looks at the currently active migration version
// and will migrate all the way up (default applying all up migrations).
Up(steps ...uint) error
// Down looks at the currently active migration version
// and will migrate all the way down (default applying all down migrations).
Down(steps ...uint) error
// Goto looks at the currently active migration version,
// then migrates either up or down to the specified version.
Goto(version uint) error
// Force sets a migration version and clears the dirty state without
// running migrations.
Force(version int) error
// Version returns the currently active migration version.
// If no migration has been applied, yet, it will return ErrNilVersion.
Version() (version uint, dirty bool, err error)
// Close source and database, return source error and database error
Close() (error, error)
}
Click to show internal directories.
Click to hide internal directories.