migrate

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedDBType = errors.New("unsupported db type")

Functions

func Migrate

func Migrate(
	db *sql.DB,
	dbType DBType,
	dbName string,
	migrationsDirPath string,
) error

func Rollback

func Rollback(
	db *sql.DB,
	dbType DBType,
	dbName string,
	migrationsDirPath string,
) error

Types

type DBType

type DBType string
const (
	DBTypeSqlite3 DBType = "sqlite3"
)

func (DBType) String

func (t DBType) String() string

type Migrator

type Migrator interface {
	Up() error
	Down() error
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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