abcdatabase

package
v5.0.17 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNoMigrations occurs if no migration files can be found on disk
	ErrNoMigrations = errors.New("no migrations found")
)

Functions

func GetConnStr

func GetConnStr(cfg abcconfig.DBConfig) (string, error)

GetConnStr returns a connection string for the database software used

func IsMigrated

func IsMigrated(cfg abcconfig.DBConfig) (bool, int64, error)

IsMigrated returns true if the database is migrated to the latest migration in the db/migrations folder. It also returns the current database migration version number.

func RunMigrations

func RunMigrations(cfg abcconfig.DBConfig, migrationsPath string) (int, error)

RunMigrations executes the migrations "up" against the passed in database and returns the number of migrations run.

Types

This section is empty.

Jump to

Keyboard shortcuts

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