mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-29 02:28:10 -07:00
DriverConfig.Params enables generic db parameters
This commit is contained in:
@@ -47,15 +47,15 @@ func Register(name string, driver Driver) {
|
||||
}
|
||||
|
||||
// Open creates a pool of data store connections specified by a models configuration.
|
||||
func Open(conf *config.DriverConfig) (Pool, error) {
|
||||
driver, ok := drivers[conf.Driver]
|
||||
func Open(cfg *config.DriverConfig) (Pool, error) {
|
||||
driver, ok := drivers[cfg.Name]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf(
|
||||
"unknown driver %q (forgotten import?)",
|
||||
conf.Driver,
|
||||
cfg.Name,
|
||||
)
|
||||
}
|
||||
pool := driver.New(conf)
|
||||
pool := driver.New(cfg)
|
||||
return pool, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user