From dd3a961436868c32585b201b2da2dd5be23d609c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 16 May 2026 15:46:34 +0300 Subject: Configure SQLite for NFS-backed deployments --- internal/repository/sqlite_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'internal/repository/sqlite_test.go') diff --git a/internal/repository/sqlite_test.go b/internal/repository/sqlite_test.go index 706f911..a295fa4 100644 --- a/internal/repository/sqlite_test.go +++ b/internal/repository/sqlite_test.go @@ -1129,6 +1129,24 @@ func TestSQLite_OpenFailures(t *testing.T) { } func TestSQLite_SchemaInitialization(t *testing.T) { + t.Run("open configures sqlite for single-process nfs use", func(t *testing.T) { + s := newTestStore(t) + defer s.Close() + + stats := s.db.Stats() + if stats.MaxOpenConnections != 1 { + t.Fatalf("expected max open connections 1, got %d", stats.MaxOpenConnections) + } + + var timeout int + if err := s.db.QueryRow(`PRAGMA busy_timeout`).Scan(&timeout); err != nil { + t.Fatalf("busy timeout pragma: %v", err) + } + if timeout != sqliteBusyTimeoutMS { + t.Fatalf("expected busy_timeout %d, got %d", sqliteBusyTimeoutMS, timeout) + } + }) + t.Run("fresh database includes podcast column and foreign keys", func(t *testing.T) { s := newTestStore(t) defer s.Close() -- cgit v1.2.3