fix(db): use separate DSN for both drivers

This commit is contained in:
sentriz
2025-12-05 17:52:29 +01:00
parent b67c1c14d2
commit 469649935e
13 changed files with 75 additions and 52 deletions

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
//go:build !nowasm
package deps
import (
"net/url"
// Cgo-free Wasm database
_ "github.com/ncruces/go-sqlite3/driver"
_ "github.com/ncruces/go-sqlite3/embed"
// Cgo-free Wasm tagger
"go.senan.xyz/gonic/tags/taglib"
)
//nolint:gochecknoglobals
var TagReader = taglib.Reader{}
// DBDriverOptions returns SQLite DSN options for the ncruces driver
func DBDriverOptions() url.Values {
return url.Values{
"_pragma": {
"busy_timeout(30000)",
"journal_mode(WAL)",
"foreign_keys(ON)",
},
}
}