SQLite never runs in WAL mode: the database URL uses a parameter the driver ignores #123

Closed
opened 2026-10-08 08:48:57 +02:00 by clawbot · 2 comments
Collaborator

The default database URL asks for _journal_mode=WAL (internal/config/config.go, internal/db/db.go), but that is the parameter name of a different SQLite driver; the pure-Go driver this repository uses (modernc.org/sqlite) does not read it, so the database never runs in WAL mode. Found while checking the README against the code for #120.

Definition of done

  1. A database opened with the default URL is in WAL mode with the intended busy timeout, set the way modernc.org/sqlite reads them (its _pragma parameters, or the equivalent pragmas run on open).
  2. A test opens a file database through the normal path and checks PRAGMA journal_mode returns wal.
  3. README.md's database section matches.
  4. One reviewed PR against next.

Model: opus-5-5

The default database URL asks for `_journal_mode=WAL` (`internal/config/config.go`, `internal/db/db.go`), but that is the parameter name of a different SQLite driver; the pure-Go driver this repository uses (`modernc.org/sqlite`) does not read it, so the database never runs in WAL mode. Found while checking the README against the code for https://git.eeqj.de/sneak/neoirc/pulls/120. ## Definition of done 1. A database opened with the default URL is in WAL mode with the intended busy timeout, set the way `modernc.org/sqlite` reads them (its `_pragma` parameters, or the equivalent pragmas run on open). 2. A test opens a file database through the normal path and checks `PRAGMA journal_mode` returns `wal`. 3. `README.md`'s database section matches. 4. One reviewed PR against `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-08 08:48:58 +02:00
Author
Collaborator

Plan: the default database URL sets WAL mode and the 5000 ms busy timeout through modernc.org/sqlite's own _pragma=journal_mode(WAL) and _pragma=busy_timeout(5000) parameters, checked against the documentation of the driver version go.mod pins. A test in internal/db opens a file database in a temp directory through the normal open path and checks PRAGMA journal_mode returns wal and the busy timeout is set. README.md's database section updated to match.

Model: opus-5-5

Plan: the default database URL sets WAL mode and the 5000 ms busy timeout through `modernc.org/sqlite`'s own `_pragma=journal_mode(WAL)` and `_pragma=busy_timeout(5000)` parameters, checked against the documentation of the driver version `go.mod` pins. A test in `internal/db` opens a file database in a temp directory through the normal open path and checks `PRAGMA journal_mode` returns `wal` and the busy timeout is set. `README.md`'s database section updated to match. Model: opus-5-5
Author
Collaborator

Built in #134: the default database URL now sets WAL mode and the 5000 ms busy timeout with the driver's _pragma parameters, kept in one constant in internal/config; a test in internal/db opens a file database through the normal open path and checks both; README.md matches.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/neoirc/pulls/134: the default database URL now sets WAL mode and the 5000 ms busy timeout with the driver's `_pragma` parameters, kept in one constant in `internal/config`; a test in `internal/db` opens a file database through the normal open path and checks both; `README.md` matches. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#123