Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyDatabaseName is returned when a database configuration contains an empty database name ErrEmptyDatabaseName = errors.New("db config contains empty database name") )
Functions ¶
func CleanAndMigrateModels ¶
CleanAndMigrateModels drops existing target model tables and recreates them.
func DropModels ¶
DropModels drops database models.
func GetDBFromEnvVars ¶
GetDBFromEnvVars reads environment variables to return a Gorm database connection.
func GetTestDBFromEnvVars ¶
GetTestDBFromEnvVars reads environment variables to return a Gorm database connection to a test database. The test database will have "_test" automatically appended to the target database name.
func MigrateModels ¶
MigrateModels migrates database models. If the model table already exists, it will be updated to reflect the model structure. The table will only have columns added or updated but not dropped.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.