Versions in this module Expand all Collapse all v2 v2.0.1 Feb 17, 2023 Changes in this version + var ErrTooManyAppliedMigrations = errors.New("too many applied migrations") + type Commands interface + Exec func(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) + Query func(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + QueryRow func(ctx context.Context, sql string, args ...any) pgx.Row + type Conn interface + Begin func(ctx context.Context) (pgx.Tx, error) + type Logger interface + Log func(msg string, data map[string]any) + type LoggerFunc func(msg string, data map[string]any) + func (f LoggerFunc) Log(msg string, data map[string]any) + type Migration interface + Run func(context.Context, Commands) error + func NewMigration(name string, fn MigrationFunc) Migration + func NewRawMigration(name, sql string) Migration + type MigrationFunc func(context.Context, Commands) error + type Migrator struct + func New(opts ...Option) (*Migrator, error) + func (m *Migrator) Migrate(ctx context.Context, db Conn) error + func (m *Migrator) Pending(ctx context.Context, db Conn) ([]Migration, error) + type Option func(*Migrator) + func Log(logger Logger) Option + func Migrations(migrations ...Migration) Option + func TableName(tableName string) Option Other modules containing this package github.com/z0ne-dev/mgx