- Configuring PRAGMAs. We need to send the following PRAGMA commands right after opening the connection:
PRAGMA journal_mode = WAL;
- enables write-ahead log so that your reads do not block writes and vice-versa.
PRAGMA busy_timeout = 5000;
- sqlite will wait 5 seconds to obtain a lock before returning SQLITE_BUSY errors, which will significantly reduce them.
PRAGMA synchronous = NORMAL;