Versions in this module Expand all Collapse all v0 v0.0.1 Dec 16, 2021 Changes in this version + type Config struct + Database string + Driver string + Host string + Options map[string]string + Password string + Port string + Username string + func (c *Config) URL() string + type Migration struct + Deprecated bool + Down string + DownFn func(context.Context, *sql.DB) error + DownTest func(context.Context, *sql.DB, *testing.T) + Name string + Up string + UpFn func(context.Context, *sql.DB) error + UpTest func(context.Context, *sql.DB, *testing.T) + type Migrator struct + func NewMigrator(c *Config) *Migrator + func (m *Migrator) AddMigration(migration *Migration) + func (m *Migrator) AddMigrations(steps ...*Migration) []*Migration + func (m *Migrator) CurrentVersion(ctx context.Context) (int64, error) + func (m *Migrator) Len() int64 + func (m *Migrator) Reset(ctx context.Context) (int64, error) + func (m *Migrator) Rollback(ctx context.Context) (int64, error) + func (m *Migrator) RollbackTo(ctx context.Context, targetVersion int64) (int64, error) + func (m *Migrator) Run(ctx context.Context) (int64, error) + func (m *Migrator) RunAllTests(t *testing.T) + func (m *Migrator) RunDownTests(t *testing.T) + func (m *Migrator) RunUpTests(t *testing.T) + func (m *Migrator) Step(ctx context.Context, db *sql.DB) (int64, error) + func (m *Migrator) StepTo(ctx context.Context, targetVersion int64) (int64, error)