Run SQLite in WAL mode with a busy timeout the driver reads (closes #123)
check / check (push) Canceled after 0s

The default database URL asked for WAL mode with `_journal_mode` and
`_busy_timeout`, which the SQLite driver does not read, so the database
ran in rollback-journal mode. The default now uses the driver's
`_pragma=journal_mode(WAL)` and `_pragma=busy_timeout(5000)` parameters,
in one constant that both the config default and the database fallback
use. A new test opens a file database with those parameters through
db.New and checks the journal mode and busy timeout. README.md's
database text now matches, and an in-memory test database drops the
same ignored parameter.

Model: opus-5-5
This commit is contained in:
2026-10-20 08:50:14 +00:00
parent a054bf828d
commit cf89113e11
5 changed files with 116 additions and 32 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ func (database *Database) GetDB() *sql.DB {
func (database *Database) connect(ctx context.Context) error {
dbURL := database.params.Config.DBURL
if dbURL == "" {
dbURL = "file:///var/lib/neoirc/state.db?_journal_mode=WAL&_busy_timeout=5000"
dbURL = config.DefaultDBURL
}
database.log.Info(