iedc-go/dri/db/auto.go

17 lines
411 B
Go
Raw Normal View History

2019-11-10 08:42:49 +00:00
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) {
2019-11-10 08:49:05 +00:00
if appIns.Config.GetString("dbType") == "sqlite" || strings.Index(appIns.Config.GetString("dbName"), ".db") == len(appIns.Config.GetString("dbName"))-3 {
2019-11-10 08:42:49 +00:00
sqlite.SetDB(appIns)
} else {
mysql.SetDB(appIns)
}
}