migrate

package
v1.7.27 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidConfig for source or db.
	ErrInvalidConfig = errors.New("invalid config")

	// ErrInvalidMigration happened.
	ErrInvalidMigration = errors.New("invalid migration")
)

Functions

func NewMigrator added in v1.3.0

func NewMigrator(tracer opentracing.Tracer) migrator.Migrator

NewMigrator for databases.

Types

type Config

type Config struct {
	Databases []Database `yaml:"databases"`
}

Config for migrate.

func (*Config) Database

func (c *Config) Database(name string) *Database

Database by name.

type Database

type Database struct {
	Name   string `yaml:"name"`
	Source string `yaml:"source"`
	URL    string `yaml:"url"`
}

Database for migrate.

type Migrator

type Migrator struct{}

Migrator using migrate.

func (*Migrator) Migrate

func (m *Migrator) Migrate(ctx context.Context, source, db string, version uint64) ([]string, error)

Migrate a database to a version and returning the database logs.

func (*Migrator) Ping added in v1.4.0

func (m *Migrator) Ping(ctx context.Context, source, db string) error

Ping the migrator.

Directories

Path Synopsis
trace

Jump to

Keyboard shortcuts

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