SQLite Forum

Is write permission required for read-only connections on a WAL database?
Login
Many thanks to you all. The summary, as far as I understand, is:

1. YES a read-only process can access a WAL database, without any ill side effects (I still don't know how it works).
2. BUT such a connection *requires* that the -wal and -shm files are present before it starts reading.

I can't help but feeling that something is odd with the second sentence, because sqlite3_close_v2 is [documented](https://www.sqlite.org/walformat.html#operations_that_require_locks_and_which_locks_those_operations_use) to delete the -wal and -shm files:

> [...] so the closing connection runs a checkpoint (while holding SQLITE_LOCK_EXCLUSIVE) and then deletes both the WAL and WAL-index files.

To me, this means that a process without write access HAS NO GUARANTEE it can access a WAL database.