golang

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(source *m.GolangMigrationSource, updateVersion UpdateVersion, applied AppliedVersions) (m.Driver, error)

New creates a new Go migration driver. It requires a source a function for saving the executed migration version, a function for deleting a version that was migrated downwards, a function for listing all applied migrations and optionally a configuration.

Types

type AppliedVersions

type AppliedVersions func() ([]string, error)

AppliedVersions returns a list of applied versions and an error if something fails

type Driver

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

Driver is the golang migration.Driver implementation

func (*Driver) Close

func (g *Driver) Close() error

Close is the migration.Driver implementation of io.Closer

func (*Driver) Migrate

func (g *Driver) Migrate(migration *m.PlannedMigration) error

Migrate executes a planned migration

func (*Driver) Versions

func (g *Driver) Versions() ([]string, error)

Versions returns all applied migration versions

type UpdateVersion

type UpdateVersion func(id string, direction m.Direction) error

UpdateVersion takes an id and a direction and returns an error if something fails

Jump to

Keyboard shortcuts

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