Skip to content

fix(admin): move SQLite pragmas to DSN for per-connection enforcement#85

Merged
arnaugiralt merged 1 commit intofeat/admin-portalfrom
fix/move-pragmas-to-dsn
Apr 27, 2026
Merged

fix(admin): move SQLite pragmas to DSN for per-connection enforcement#85
arnaugiralt merged 1 commit intofeat/admin-portalfrom
fix/move-pragmas-to-dsn

Conversation

@victor-cuevas
Copy link
Copy Markdown
Contributor

PRAGMAs (WAL, busy_timeout, foreign_keys) were set via db.ExecContext
after sql.Open, which only configured one connection in the pool.
Other pooled connections got SQLite defaults (zero busy timeout),
causing intermittent SQLITE_BUSY errors under concurrent access.

Use _pragma DSN query parameters so modernc.org/sqlite applies them
to every new connection the pool creates.

Copy link
Copy Markdown
Member

@arnaugiralt arnaugiralt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arnaugiralt arnaugiralt merged commit 1baf4ef into feat/admin-portal Apr 27, 2026
13 checks passed
@arnaugiralt arnaugiralt deleted the fix/move-pragmas-to-dsn branch April 27, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants