migrate

package
v1.41.19 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 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")

	// ErrInvalidPing happened.
	ErrInvalidPing = errors.New("invalid ping")
)

Functions

func NewMigrator added in v1.3.0

func NewMigrator(t tracer.Tracer) migrator.Migrator

NewMigrator for databases.

Types

type Config

type Config struct {
	Databases []Database `yaml:"databases" json:"databases" toml:"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" json:"name" toml:"name"`
	Source string `yaml:"source" json:"source" toml:"source"`
	URL    string `yaml:"url" json:"url" toml:"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
telemetry

Jump to

Keyboard shortcuts

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