dbmgr

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() (ret *gorm.DB, err error)

func DBClose

func DBClose(n string) error

func DBCloseAll

func DBCloseAll()

func DBMaster

func DBMaster() (ret *gorm.DB, err error)

func DBN

func DBN(n string) (ret *gorm.DB, err error)

func DSNS

func DSNS() ([]string, error)

func DropRecreate

func DropRecreate(n string) error

func MigrationAdd

func MigrationAdd(id string, desc string, match func(s string) bool, mig func(d *gorm.DB) error)

func MigrationRun

func MigrationRun() error

func MigrationRunOnDb

func MigrationRunOnDb(dsn string) error

Types

type DBMigration

type DBMigration interface {
	ID() string
	Desc() string
	MatchDB(dsn string) bool
	Run(d *gorm.DB) error
}

Jump to

Keyboard shortcuts

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