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:
Deluan 2024-05-21 17:19:41 -04:00
parent 68f03d0167
commit 55bff343cd
18 changed files with 156 additions and 64 deletions

View file

@ -3,6 +3,7 @@ package persistence
import (
"context"
"github.com/navidrome/navidrome/db"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model"
. "github.com/onsi/ginkgo/v2"
@ -13,7 +14,7 @@ var _ = Describe("Property Repository", func() {
var pr model.PropertyRepository
BeforeEach(func() {
pr = NewPropertyRepository(log.NewContext(context.TODO()), getDBXBuilder())
pr = NewPropertyRepository(log.NewContext(context.TODO()), NewDBXBuilder(db.Db()))
})
It("saves and restore a new property", func() {