Documentation
¶
Overview ¶
Package mgx is a simple migration tool for pgx
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooManyAppliedMigrations = errors.New("too many applied migrations")
ErrTooManyAppliedMigrations is returned when more migrations are applied than defined
Functions ¶
This section is empty.
Types ¶
type Commands ¶
type Commands interface { Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row }
Commands is the interface that wraps the basic sql command methods.
type LoggerFunc ¶
LoggerFunc is a bridge between Logger and any third party logger
type Migration ¶
Migration is the migration interface
func NewMigration ¶
func NewMigration(name string, fn MigrationFunc) Migration
NewMigration creates a migration from a function.
func NewRawMigration ¶
NewRawMigration creates a migration from a raw SQL string.
type MigrationFunc ¶
MigrationFunc is a wrapper around a function so that it implements the Migration interface.
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is the migrator implementation
Click to show internal directories.
Click to hide internal directories.