package initialize import ( "github.com/flipped-aurora/gin-vue-admin/server/global" "gorm.io/gorm" ) func DBList() { dbMap := make(map[string]*gorm.DB) for _, info := range global.GVA_CONFIG.DBList { if info.Disable { continue } switch info.Type { case "mysql": dbMap[info.Dbname] = GormMysqlByConfig(info) case "pgsql": dbMap[info.Dbname] = GormPgSqlByConfig(info) default: continue } } global.GVA_DBList = dbMap }