migrate

package
v1.62.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 12 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 trace.Tracer) migrator.Migrator

NewMigrator for databases.

Types

type Config

type Config struct {
	Databases []*Database `yaml:"databases,omitempty" json:"databases,omitempty" toml:"databases,omitempty"`
}

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,omitempty" json:"name,omitempty" toml:"name,omitempty"`
	Source string `yaml:"source,omitempty" json:"source,omitempty" toml:"source,omitempty"`
	URL    string `yaml:"url,omitempty" json:"url,omitempty" toml:"url,omitempty"`
}

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