fixed: applied SQLite connection settings to every pooled connection #9

Merged
jak merged 2 commits from sqlite-connection-pragmas into main 2026-10-23 16:45:44 -04:00
Owner

Foreign keys and the busy timeout were set with PRAGMA statements after opening, so they applied only to the pool's first connection. A replaced connection would run without foreign keys, and deleting a user would leave their sessions and grants behind.

Both settings now go in the connection string as _pragma parameters, which modernc applies to every connection it opens. A path that already has a query, such as a file: URI, gets them joined with &.

The new test disables idle connections so each query opens a fresh connection, then checks both settings. It fails on main.

🤖 Generated with Claude Code

Foreign keys and the busy timeout were set with `PRAGMA` statements after opening, so they applied only to the pool's first connection. A replaced connection would run without foreign keys, and deleting a user would leave their sessions and grants behind. Both settings now go in the connection string as `_pragma` parameters, which modernc applies to every connection it opens. A path that already has a query, such as a `file:` URI, gets them joined with `&`. The new test disables idle connections so each query opens a fresh connection, then checks both settings. It fails on `main`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The database set foreign keys and the busy timeout with PRAGMA statements after
opening. Those settings apply to one connection. If the pool replaced it, the
new connection would run without foreign keys, so deleting a user would leave
their sessions and grants behind.

We moved both settings into the connection string as _pragma parameters, which
the driver applies to each connection it opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jak merged commit a8ae3f7cc9 into main 2026-10-23 16:45:44 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pollinator/consent!9
No description provided.