Keep foreign keys on for every database connection (closes #207) #208

Merged
clawbot merged 1 commits from issue-207-foreign-keys into next 2026-10-27 11:14:02 +01:00
1 Commits
Author SHA1 Message Date
clawbot 1cf3101f78 Keep foreign keys on for every database connection (closes #207)
check / check (push) Waiting to run
SQLite keeps the foreign keys setting per connection, and the server
turned it on once with a PRAGMA. A query cancelled while it runs makes
the pool replace its only connection, and the new one ran without
foreign keys until a restart.

connect now adds `_pragma=foreign_keys(1)` to the database URL. The
driver runs it on every connection it opens. The server refuses to
start when DBURL sets foreign_keys itself, because the driver sorts
the pragmas and that one could win.

One test cancels a query and checks, with a TEMP table, that the
connection was replaced and that foreign keys are on. Another checks
the startup error for several spellings.

Model: opus-5-5
2026-10-27 09:53:43 +00:00