updated sqlite engine to address compilation errors
All checks were successful
Build and Release Core / Test and Build (push) Successful in 2m54s

This commit is contained in:
t
2026-04-02 15:00:31 -04:00
parent da4699fe08
commit 5f53ffec4f
7 changed files with 47 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ import (
"time"
"epigas.gitea.cloud/RiskRancher/core/pkg/domain"
_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"
)
//go:embed schema.sql
@@ -19,9 +19,10 @@ var schemaSQL string
var defaultAdaptersFS embed.FS
func InitDB(filepath string) *sql.DB {
dsn := "file:" + filepath + "?_journal=WAL&_timeout=5000&_sync=1&_fk=1"
db, err := sql.Open("sqlite3", dsn)
dsn := "file:" + filepath + "?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)&_pragma=synchronous(NORMAL)&_pragma=foreign_keys(1)"
db, err := sql.Open("sqlite", dsn)
if err != nil {
log.Fatalf("Failed to open database: %v", err)
}