Asks SQLite to keep the WAL and shared-memory (-shm) files when this
connection closes (SQLITE_FCNTL_PERSIST_WAL,
sqlite.org/c3ref/c_fcntl_begin_atomic_write.html); true when SQLite
accepted. Every writer sets it, so the last one to close checkpoints
the WAL but leaves both files in place. Without it, the WAL files are
deleted on close, and a later read-only connection (status) creates
both and cannot delete them, which writes to the state directory
(review item B11). Apple's system SQLite, which Bun uses on macOS,
already keeps them; Bun's bundled SQLite on Linux does not.
Asks SQLite to keep the WAL and shared-memory (
-shm) files when this connection closes (SQLITE_FCNTL_PERSIST_WAL, sqlite.org/c3ref/c_fcntl_begin_atomic_write.html); true when SQLite accepted. Every writer sets it, so the last one to close checkpoints the WAL but leaves both files in place. Without it, the WAL files are deleted on close, and a later read-only connection (status) creates both and cannot delete them, which writes to the state directory (review item B11). Apple's system SQLite, which Bun uses on macOS, already keeps them; Bun's bundled SQLite on Linux does not.