Skip to main content

SQLITE_PRAGMAS

Constant SQLITE_PRAGMAS 

Source
pub const SQLITE_PRAGMAS: &str = "PRAGMA journal_mode = WAL; PRAGMA busy_timeout = 5000; PRAGMA foreign_keys = ON;";
Expand description

SQLite PRAGMAs applied to every connection for concurrent-access safety.

  • WAL mode prevents SQLITE_BUSY when multiple processes access the DB
  • 5-second busy timeout retries on transient lock contention
  • Foreign key enforcement is off by default in SQLite