chore: 更换sqlite库

This commit is contained in:
TsMask
2025-02-20 19:25:20 +08:00
parent 2fc5b44472
commit 89a66a1503
3 changed files with 17 additions and 3 deletions

View File

@@ -7,9 +7,8 @@ import (
"regexp"
"time"
// "github.com/glebarez/sqlite"
"github.com/glebarez/sqlite"
"gorm.io/driver/mysql"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
gormLog "gorm.io/gorm/logger"
@@ -130,7 +129,7 @@ func Close() {
func DB(source string) *gorm.DB {
// 不指定时获取默认实例
if source == "" {
source = config.Get("gorm.defaultDataSourceName").(string)
source = config.Get("database.defaultDataSourceName").(string)
}
return dbMap[source]
}