feat: use no cgo sqlite as default

This commit is contained in:
line-6000
2026-03-27 17:04:43 +08:00
parent 1e4cf0fdd5
commit d6e7927605
8 changed files with 122 additions and 70 deletions
+1 -3
View File
@@ -8,8 +8,6 @@ import (
"github.com/gookit/color"
"github.com/spf13/viper"
// "github.com/glebarez/sqlite"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"gorm.io/gorm/schema"
@@ -23,7 +21,7 @@ func SqliteInit() error {
dbFilename = filepath.Base(dbfile)
}
color.Green.Printf("[store_db] sqlite filename: %s\n", dbFilename)
Mdb, err = gorm.Open(sqlite.Open(dbFilename), &gorm.Config{
Mdb, err = openDB(dbFilename, &gorm.Config{
NamingStrategy: schema.NamingStrategy{
TablePrefix: viper.GetString("sqlite_table_prefix"),
SingularTable: true,