Versions in this module Expand all Collapse all v1 v1.8.0 Oct 16, 2024 v1.7.0 Oct 17, 2024 Changes in this version + var MigrationDialects = map[string]gorp.Dialect + func Exec(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection) (int, error) + func ExecContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, ...) (int, error) + func ExecMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) + func ExecMaxContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, ...) (int, error) + func ExecVersion(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, ...) (int, error) + func ExecVersionContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, ...) (int, error) + func SetDisableCreateTable(disable bool) + func SetIgnoreUnknown(v bool) + func SetSchema(name string) + func SetTable(name string) + func SkipMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) + type AssetMigrationSource struct + Asset func(path string) ([]byte, error) + AssetDir func(path string) ([]string, error) + Dir string + func (a AssetMigrationSource) FindMigrations() ([]*Migration, error) + type EmbedFileSystemMigrationSource struct + FileSystem embed.FS + Root string + func (f EmbedFileSystemMigrationSource) FindMigrations() ([]*Migration, error) + type FileMigrationSource struct + Dir string + func (f FileMigrationSource) FindMigrations() ([]*Migration, error) + type HttpFileSystemMigrationSource struct + FileSystem http.FileSystem + func (f HttpFileSystemMigrationSource) FindMigrations() ([]*Migration, error) + type MemoryMigrationSource struct + Migrations []*Migration + func (m MemoryMigrationSource) FindMigrations() ([]*Migration, error) + type Migration struct + DisableTransactionDown bool + DisableTransactionUp bool + Down []string + Id string + Up []string + func ParseMigration(id string, r io.ReadSeeker) (*Migration, error) + func ToApply(migrations []*Migration, current string, direction MigrationDirection) []*Migration + func (m Migration) Less(other *Migration) bool + func (m Migration) NumberPrefixMatches() []string + func (m Migration) VersionInt() int64 + type MigrationDirection int + const Down + const Up + type MigrationRecord struct + AppliedAt time.Time + Id string + func GetMigrationRecords(db *sql.DB, dialect string) ([]*MigrationRecord, error) + type MigrationSet struct + DisableCreateTable bool + IgnoreUnknown bool + SchemaName string + TableName string + func (ms MigrationSet) Exec(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection) (int, error) + func (ms MigrationSet) ExecContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, ...) (int, error) + func (ms MigrationSet) ExecMax(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) + func (ms MigrationSet) ExecMaxContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, ...) (int, error) + func (ms MigrationSet) ExecVersion(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, ...) (int, error) + func (ms MigrationSet) ExecVersionContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, ...) (int, error) + func (ms MigrationSet) GetMigrationRecords(db *sql.DB, dialect string) ([]*MigrationRecord, error) + func (ms MigrationSet) PlanMigration(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) ([]*PlannedMigration, *gorp.DbMap, error) + func (ms MigrationSet) PlanMigrationToVersion(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, ...) ([]*PlannedMigration, *gorp.DbMap, error) + type MigrationSource interface + FindMigrations func() ([]*Migration, error) + type OracleDialect struct + func (OracleDialect) IfSchemaNotExists(command, _ string) string + func (OracleDialect) IfTableExists(command, _, _ string) string + func (OracleDialect) IfTableNotExists(command, _, _ string) string + type PackrBox interface + Find func(name string) ([]byte, error) + List func() []string + type PackrMigrationSource struct + Box PackrBox + Dir string + func (p PackrMigrationSource) FindMigrations() ([]*Migration, error) + type PlanError struct + ErrorMessage string + Migration *Migration + func (p *PlanError) Error() string + type PlannedMigration struct + DisableTransaction bool + Queries []string + func PlanMigration(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) ([]*PlannedMigration, *gorp.DbMap, error) + func PlanMigrationToVersion(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, ...) ([]*PlannedMigration, *gorp.DbMap, error) + func ToCatchup(migrations, existingMigrations []*Migration, lastRun *Migration) []*PlannedMigration + type SqlExecutor interface + Delete func(list ...interface{}) (int64, error) + Exec func(query string, args ...interface{}) (sql.Result, error) + Insert func(list ...interface{}) error + type TxError struct + Err error + Migration *Migration + func (e *TxError) Error() string