This commit is contained in:
2025-07-07 20:11:59 +08:00
parent ab0fdbc447
commit 06e3aa2eb3
2009 changed files with 193082 additions and 0 deletions

21
database/sqlite/sqlite.go Normal file
View File

@ -0,0 +1,21 @@
package sqlite
import (
"fmt"
"github.com/glebarez/sqlite"
"github.com/tiger1103/gfast/v3/database"
"gorm.io/gorm"
)
func InitSqlite(path string) {
fmt.Println(path)
db, err := OpenDB(path)
if err != nil {
return
}
database.SetORMDBInstance(db)
}
func OpenDB(path string) (*gorm.DB, error) {
return gorm.Open(sqlite.Open(path), &gorm.Config{})
}