hotime/dri/db/auto.go
2019-11-10 16:42:49 +08:00

17 lines
370 B
Go

package db
import (
"code.hoteas.com/hoteas/hotime"
"code.hoteas.com/hoteas/hotime/dri/mysql"
"code.hoteas.com/hoteas/hotime/dri/sqlite"
"strings"
)
func SetDB(appIns *hotime.Application) {
if appIns.Config.GetString("dbType") == "sqlite" || strings.Contains(appIns.Config.GetString("dbName"), ".db") {
sqlite.SetDB(appIns)
} else {
mysql.SetDB(appIns)
}
}