diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-16 15:46:34 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-16 15:46:34 +0300 |
| commit | dd3a961436868c32585b201b2da2dd5be23d609c (patch) | |
| tree | e3beaf620045b8c08adeca852df59e7e664aeef2 /internal/repository/sqlite_test.go | |
| parent | 0a9660a6eeece467e94b395fdc0c8ad96d29e133 (diff) | |
Configure SQLite for NFS-backed deployments
Diffstat (limited to 'internal/repository/sqlite_test.go')
| -rw-r--r-- | internal/repository/sqlite_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
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() |
