revert InitModuleDB pattern, back to single ModuleDB func
This commit is contained in:
13
dbx.go
13
dbx.go
@@ -92,17 +92,8 @@ func SQLO() *sql.DB {
|
||||
return sqlDB
|
||||
}
|
||||
|
||||
// ModuleDB returns the existing database module, or panics if it has not
|
||||
// been initialized yet.
|
||||
func ModuleDB() *app.Module {
|
||||
if dbxshared.DBModule == nil {
|
||||
panic("ModuleDB not initialized yet")
|
||||
}
|
||||
return dbxshared.DBModule
|
||||
}
|
||||
|
||||
// InitModuleDB returns the database module with the provided configuration.
|
||||
func InitModuleDB(dialect Dialect, cfg *DBConfig, forceDebugLog bool) *app.Module {
|
||||
// ModuleDB returns the database module with the provided configuration.
|
||||
func ModuleDB(dialect Dialect, cfg *DBConfig, forceDebugLog bool) *app.Module {
|
||||
if dbxshared.DBModule != nil {
|
||||
panic("ModuleDB initialized multiple times")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user