feat(activity): add SQLite PRAGMA and connection pool config #339
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/steeper!339
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/289-sqlite-pragmas"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Configure SQLite on
Cache.Open()with standard embedded SQLite best practices:PRAGMA journal_mode=WAL— concurrent read/write performancePRAGMA foreign_keys=ON— referential integritydb.SetMaxOpenConns(1)— prevent SQLITE_BUSY from concurrent writesWhy
The cache previously used SQLite defaults which lack WAL journaling and foreign key enforcement. A single concurrent writer connection prevents locking errors in an embedded context.
Testing
go buildpassesgo test -race -short ./...passes (all cache tests exercise the new configuration)Closes #289
Review
Result: Approved — no issues. Closes #289.
13 lines adding
PRAGMA journal_mode=WAL,PRAGMA foreign_keys=ON, anddb.SetMaxOpenConns(1)toCache.Open(). Applied after ping, before migration. Errors handled — closes DB and returns wrapped error. Clean.