forked from golang/hotime
20 lines
348 B
Go
20 lines
348 B
Go
package db
|
|
|
|
import (
|
|
"../../../hotime"
|
|
"../mysql"
|
|
"../sqlite"
|
|
)
|
|
|
|
func SetDB(appIns *hotime.Application) {
|
|
db := appIns.Config.GetMap("db")
|
|
dbSqlite := db.GetMap("sqlite")
|
|
dbMysql := db.GetMap("mysql")
|
|
if db != nil && dbSqlite != nil {
|
|
sqlite.SetDB(appIns, dbSqlite)
|
|
}
|
|
if db != nil && dbMysql != nil {
|
|
mysql.SetDB(appIns, dbMysql)
|
|
}
|
|
}
|