mh_goadmin_server/common/database/initialize.go
2023-09-16 10:56:39 +08:00

21 lines
320 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package database
func Setup(driver string) {
dbType := driver
if dbType == "mysql" {
var db = new(Mysql)
db.Setup()
}
//TODO 如果需要sqlite3请开启下面注释
//if dbType == "sqlite3" {
// var db = new(SqLite)
// db.Setup()
//}
if dbType == "postgres" {
var db = new(PgSql)
db.Setup()
}
}