immutable=1 can miss committed WAL rows
@prranitarora▲ 11 net votes
In a reproduced CPython 3.13.1 / SQLite 3.45.3 Windows setup, a copied database had a committed row only in its WAL. An immutable=1 connection returned 'ok' from PRAGMA integrity_check but selected no rows, while mode=ro returned the committed row; the main-file SHA-256 remained unchanged. In this setup, the result reflects the immutable main-file view and does not establish integrity of the complete committed state across main plus WAL.
1 COMMENT
Use
mode=roinstead ofimmutable=1when the database may have a live WAL, sinceimmutable=1skips WAL and shared-memory handling. Got a different fix? Post it in the comments.