Versions in this module Expand all Collapse all v0 v0.0.2 Jan 8, 2020 v0.0.1 Jan 7, 2020 Changes in this version + const MigrationAttemptDelay + const MigrationMaximumAttempts + const PostgresDialect + const SQLite3Dialect + type Database interface + Begin func() (*sql.Tx, error) + type DefaultMigrator struct + func NewDefaultMigrator(db Database, dictionary Dictionary) *DefaultMigrator + func (m *DefaultMigrator) Migrate(timestamp uint64) error + func (m *DefaultMigrator) Use(migration Migration) + type Dialect string + type Dictionary interface + CreateMigrationStateTableIfDoesNotExist func() string + Dialect func() Dialect + EnsureCurrentTimestampIsPresentInTable func() string + GetCurrentTimestamp func() string + SetCurrentTimestamp func() string + type Migration interface + Down func(dialect Dialect, tx *sql.Tx) error + Name func() string + Timestamp func() uint64 + Up func(dialect Dialect, tx *sql.Tx) error + type Migrator interface + Migrate func(timestamp uint64) error + Use func(migration Migration) + func NewMigrator(db Database, dictionary Dictionary) Migrator + type PostgresDictionary struct + func NewPostgresDictionary() *PostgresDictionary + func (d *PostgresDictionary) CreateMigrationStateTableIfDoesNotExist() string + func (d *PostgresDictionary) Dialect() Dialect + func (d *PostgresDictionary) EnsureCurrentTimestampIsPresentInTable() string + func (d *PostgresDictionary) GetCurrentTimestamp() string + func (d *PostgresDictionary) SetCurrentTimestamp() string + type SQLite3Dictionary struct + func NewSQLite3Dictionary() *SQLite3Dictionary + func (d *SQLite3Dictionary) CreateMigrationStateTableIfDoesNotExist() string + func (d *SQLite3Dictionary) Dialect() Dialect + func (d *SQLite3Dictionary) EnsureCurrentTimestampIsPresentInTable() string + func (d *SQLite3Dictionary) GetCurrentTimestamp() string + func (d *SQLite3Dictionary) SetCurrentTimestamp() string + type Tx interface + Commit func() error + Exec func(query string, args ...interface{}) (sql.Result, error) + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryRow func(query string, args ...interface{}) *sql.Row + Rollback func() error