postgres

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingDatabaseName = errors.New("missing database name")
)

Functions

func Migrate

func Migrate(ctx context.Context, req MigrateRequest) error

func New

func New(source migrations.Source, db target.DB, databaseName, tableName string) (*target.Target, error)

Types

type MigrateRequest

type MigrateRequest struct {
	DB           target.DB
	Source       migrations.Source
	DatabaseName string
	TableName    string
	Reporter     migrations.RunnerReporter
}

type Postgres

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

func (*Postgres) Add

func (p *Postgres) Add(migration migrations.Migration) error

func (*Postgres) Lock

func (p *Postgres) Lock() (migrations.Unlocker, error)

func (*Postgres) Remove

func (p *Postgres) Remove(migration migrations.Migration) error

type TXExecer

type TXExecer interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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