mgx package - github.com/z0ne-dev/mgx - Go Packages

Package mgx is a simple migration tool for pgx

This section is empty.

This section is empty.

This section is empty.

type Commands ΒΆ

Commands is the interface that wraps the basic sql command methods.

Conn is the interface that wraps the basic connection methods.

LoggerFunc is a bridge between Logger and any third party logger

Log implements Logger interface

Migration is the migration interface

NewMigration creates a migration from a function.

func NewRawMigration(name, sql string) Migration

NewRawMigration creates a migration from a raw SQL string.

MigrationFunc is a wrapper around a function so that it implements the Migration interface.

Migrator is the migrator implementation

New creates a new migrator instance

Migrate applies all available migrations

Pending returns all pending (not yet applied) migrations

type Option func(*Migrator)

Option sets options such migrations or table name.

func Log(logger Logger) Option

Log creates an option to allow overriding the stdout logging

func Migrations(migrations ...Migration) Option

Migrations creates an option with provided migrations

func TableName(tableName string) Option

TableName creates an option to allow overriding the default table name