mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Optimize SQLite3 access. Mainly separate read access from write access.
Based on tips from https://archive.is/Xfjh6#selection-257.0-278.0
This commit is contained in:
parent
68f03d0167
commit
55bff343cd
18 changed files with 156 additions and 64 deletions
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/navidrome/navidrome/tests"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/pocketbase/dbx"
|
||||
)
|
||||
|
||||
func TestPersistence(t *testing.T) {
|
||||
|
@ -29,10 +28,6 @@ func TestPersistence(t *testing.T) {
|
|||
RunSpecs(t, "Persistence Suite")
|
||||
}
|
||||
|
||||
func getDBXBuilder() *dbx.DB {
|
||||
return dbx.NewFromDB(db.Db(), db.Driver)
|
||||
}
|
||||
|
||||
var (
|
||||
genreElectronic = model.Genre{ID: "gn-1", Name: "Electronic"}
|
||||
genreRock = model.Genre{ID: "gn-2", Name: "Rock"}
|
||||
|
@ -95,7 +90,7 @@ func P(path string) string {
|
|||
// Initialize test DB
|
||||
// TODO Load this data setup from file(s)
|
||||
var _ = BeforeSuite(func() {
|
||||
conn := getDBXBuilder()
|
||||
conn := NewDBXBuilder(db.Db())
|
||||
ctx := log.NewContext(context.TODO())
|
||||
user := model.User{ID: "userid", UserName: "userid", IsAdmin: true}
|
||||
ctx = request.WithUser(ctx, user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue