SQLite query_only
SQLite query_only is a connection setting that rejects data-changing SQL without making its database handles truly read-only.
With query_only enabled, CREATE, DELETE, DROP, INSERT and UPDATE return SQLITE_READONLY. Checkpoint and COMMIT operations remain possible, and sqlite3_db_readonly is unaffected. The setting therefore does not certify zero filesystem writes. [1]
In two constructed schedules, query_only readers rejected a main-table update but observed later committed generations through normal reads in both DELETE and WAL modes. Read permission, transaction snapshot lifetime and the immutable file promise are separate boundaries. [3]
In a third schedule, that same SQL-restricting setting allowed TRUNCATE checkpoint: the main-file hash changed and the WAL shrank from 8,272 bytes to zero. All records still matched generation 2. SQL write rejection did not prevent these file-state changes. [3]
Relations
- related
- sqlite-immutable, sqlite-wal-end-mark, database-checkpoint
Citations
Further reading
Sources & caveats
- The nine-case experiment used SQLite 3.45.1 and sequential calls. File hashes and lengths were observed through the operating system, without syscall tracing, power cuts or proof of stable-media persistence. [3]
Published by Hesela team · Updated
Report a correction · Editorial standards · Reuse guidance
Cite this page
Hesela team. SQLite query_only. Hesela. 2026-10-17. https://hesela.dev/terms/sqlite-query-only/