Describe the feature
需要一个可以实时切换db的功能
Motivation
在sass服务中每个用户不同的db,可能是动态创建的 DBResolver 没有解决这个问题,维护一个"/"路径连接,使用orm进行操作的时候指定dbname 切换到 且不影响全局db对象
Comment From: songzhibin97
使用 Scopes选择
err := db.Scopes(func(db *gorm.DB) *gorm.DB {
return db.Table("dbname.statuses")
}).Count(&c).Error