SQLite Forum

Is write permission required for read-only connections on a WAL database?
Login
That depends on what you mean by "reader without write permissions".  

If by that you mean that CREATE/DROP/INSERT/ALTER/DELETE/UPDATE statements are "intercepted with a 'you cannot do that you silly twit` error message" then that is merely an artificial limitation (conceptually similar to having a guard at the paint-store-door that will refuse to sell you pink paint) -- we call that LOGICAL access control because it is not real, it is merely a convention, sort of like DRM or a flag saying "NotEvil".  It does not mean that the process does not have PHYSICAL ACTUAL REAL write access, merely that it is LOGICALLY preventing you from having it -- as long as you play along.

A LOGICAL (ie, application level) read-only connection is still required to have PHYSICAL (ie, Operating System level) write-access to the SHM file.  *YOU* are prevented from writing to the database files, however SQLITE itself has no such limitation.

If the Operating System cannot grant write access to the SHM file, then the database must be immutable (no one can change it).  If the database is immutable and nonetheless is "mutated", all hell will break loose.  

SQLite requires READ/WRITE access to the SHM (wal index) by all processes connecting to a "mutable" database even if the connection is LOGICALLY read-only.

<https://sqlite.org/walformat.html> particularly the descriptions of the READ_LOCK[N] fields in the SHM (index) file and how they work might be helpful.