pub fn set_wal_autocheckpoint(
conn: &Connection,
pages: u32,
) -> Result<(), ReplicaError>Expand description
Set PRAGMA wal_autocheckpoint = pages on one connection — the WAL-growth knob a
host that wants to own its checkpoint schedule passes at open
(OpenOptions::wal_autocheckpoint; design 410 §3.5).
0 disables SQLite’s automatic checkpoint entirely, so the WAL only ever folds back
on an explicit PRAGMA wal_checkpoint (the replica’s maintain). That is the mobile
posture: a phone would otherwise pay an unpredictable multi-megabyte checkpoint
inside whichever commit happens to cross the threshold — mid-gesture, at 60 Hz — and
would rather take it at a moment of its choosing (gesture end, idle, backgrounding).
A host that does NOT set this keeps SQLite’s default of 1000 pages, which is what
every server-side opener wants.
Connection-local (it is not persisted in the file) and only meaningful on the connection that actually writes, so callers apply it to the writer.