mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
feat: handle the dataSourceName when DB changes (#1352)
* fix: handle the dataSourceName when DB changes * reduce duplication of code
This commit is contained in:
10
conf/conf.go
10
conf/conf.go
@ -120,3 +120,13 @@ func GetConfigBatchSize() int {
|
||||
func GetConfigQuota() *Quota {
|
||||
return quota
|
||||
}
|
||||
|
||||
func GetConfigRealDataSourceName(driverName string) string {
|
||||
var dataSourceName string
|
||||
if driverName != "mysql" {
|
||||
dataSourceName = GetConfigDataSourceName()
|
||||
} else {
|
||||
dataSourceName = GetConfigDataSourceName() + GetConfigString("dbName")
|
||||
}
|
||||
return dataSourceName
|
||||
}
|
||||
|
Reference in New Issue
Block a user