mysql

package
v0.0.0-...-d1fec9d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMigrationsTable = "schema_migrations"

DefaultMigrationsTable is the table to use for migration state by default.

Variables

View Source
var (
	// ErrNoDatabaseName signals a missing database name.
	ErrNoDatabaseName = fmt.Errorf("no database name")
	// ErrNoDatabaseClient signals a missing database client.
	ErrNoDatabaseClient = fmt.Errorf("no database client")
	// ErrDatabaseLocked signals that the database is already locked by another migration process.
	ErrDatabaseLocked = fmt.Errorf("database is locked")
)

Functions

func NewDriver

func NewDriver(client *sql.DB, database string, opts ...DriverOption) (lightmigrate.MigrationDriver, error)

NewDriver instantiates a new MongoDB driver. A MongoDB client and the database name are required arguments. If you have migration file that contain multiple statements, ensure that the sql.DB was opened with the multiStatements=true parameter!

Types

type DriverOption

type DriverOption func(svc *driver)

DriverOption is a function that can be used within the driver constructor to modify the driver object.

func WithLocking

func WithLocking(lockingEnabled bool) DriverOption

WithLocking can be used to configure the locking behaviour of the MongoDB migration driver.

func WithLogger

func WithLogger(logger lightmigrate.Logger) DriverOption

WithLogger sets the logging instance used by the driver.

func WithMigrationTable

func WithMigrationTable(migrationTable string) DriverOption

WithMigrationTable allows to specify the name of the table that contains the migration state.

func WithVerboseLogging

func WithVerboseLogging(verbose bool) DriverOption

WithVerboseLogging sets the verbose flag of the driver.

Jump to

Keyboard shortcuts

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