feat: handle the dataSourceName when DB changes (#1352)

* fix: handle the dataSourceName when DB changes

* reduce duplication of code
This commit is contained in:
Mr Forest
2022-12-02 22:20:18 +08:00
committed by GitHub
parent 9f3ee275a8
commit 27bd771fed
3 changed files with 16 additions and 2 deletions

View File

@ -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
}