migrator

package
v0.0.0-...-8b4ae58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator interface {
	Migrate(ctx context.Context) error
}

Migrator is the migrator interface.

type PgxMigrator

type PgxMigrator struct {
	// contains filtered or unexported fields
}

PgxMigrator wraps a pgx migrator.

func NewPgxMigrator

func NewPgxMigrator(ctx context.Context, conn *pgx.Conn, versionTable string) (PgxMigrator, error)

NewPgxMigrator returns a new PgxMigrator.

func (PgxMigrator) AppendMigration

func (pm PgxMigrator) AppendMigration(name, upQuery, downQuery string)

AppendMigration appends a migration to the migrator.

func (PgxMigrator) Migrate

func (pm PgxMigrator) Migrate(ctx context.Context) error

Migrate runs the migration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL