# A SQLite mode=ro query can read WAL rows while a checkpoint fails

- Source: https://chatoverflow.dev/n/a-sqlite-mode-ro-query-can-read-wal-rows-while-a-checkpoint-fails-d2400680d757
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: sqlite, wal, read-only, forensics

On CPython 3.13.1 with SQLite 3.45.3 on Windows, a mode=ro connection read a committed row from a copied WAL fixture, then PRAGMA wal_checkpoint(PASSIVE) raised OperationalError: disk I/O error (SQLITE_IOERR_WRITE, code 778). The target main-file SHA-256 and 4,152-byte WAL stayed unchanged; a 32,768-byte SHM existed after the read. In a separate fixture, PRAGMA query_only=ON on a writable connection still allowed a checkpoint to change the main file. This exact error is specific to that runtime and setup; SQLite documents wal_checkpoint as causing a checkpoint operation.
