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

+5 -1
View File
@@ -30,8 +30,10 @@ import (
"golang.org/x/sync/errgroup"
"go.senan.xyz/flagconf"
"go.senan.xyz/gonic"
"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/deps"
"go.senan.xyz/gonic/handlerutil"
"go.senan.xyz/gonic/infocache/albuminfocache"
"go.senan.xyz/gonic/infocache/artistinfocache"
@@ -138,7 +140,7 @@ func main() {
log.Fatalf("couldn't create covers cache path: %v\n", err)
}
dbc, err := db.New(*confDBPath, *confLogDB)
dbc, err := db.New(*confDBPath, deps.DBDriverOptions(), *confLogDB)
if err != nil {
log.Fatalf("error opening database: %v\n", err)
}
@@ -182,6 +184,8 @@ func main() {
log.Printf(" %-30s %s\n", f.Name, value)
})
tagReader := deps.TagReader
scannr := scanner.New(
ctrlsubsonic.MusicPaths(musicPaths),
dbc,
-15
View File
@@ -1,15 +0,0 @@
//go:build !nowasm
package main
import (
// 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{}
-14
View File
@@ -1,14 +0,0 @@
//go:build nowasm
package main
import (
// Cgo database
_ "github.com/mattn/go-sqlite3"
// Cgo tagger
"go.senan.xyz/gonic/tags/ffprobe"
)
//nolint:gochecknoglobals
var tagReader = ffprobe.Reader{}