SQLite Forum

readonly access to WAL database
I think you simply shouldn't use the stock SQLite shell in this case. The [`SQLITE_FCNTL_PERSIST_WAL` mode][1] you found is cooperative: all processes requiring that behavior have to apply that mode for it to work as expected.

If you're just using the shell to test things, the solution ends there. If instead you really do need a SQL command shell for your application, I suggest that you hack the stock shell to have the behavior you need.

I'd then install it under a different name (e.g. `myappsqlshell`) to differentiate it from a stock `sqlite3` app.

[1]: https://www.sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlpersistwal