iedc-go/tools/db/auto.go

20 lines
348 B
Go
Raw Normal View History

2019-11-10 08:42:49 +00:00
package db
import (
2021-05-21 20:52:03 +00:00
"../../../hotime"
"../mysql"
"../sqlite"
2019-11-10 08:42:49 +00:00
)
func SetDB(appIns *hotime.Application) {
2021-05-23 21:47:56 +00:00
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)
2019-11-10 08:42:49 +00:00
}
}