iedc-go/tools/db/auto.go
2021-05-24 05:47:56 +08:00

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)
}
}