Rindle docs and package mapSkip to main content

set_foreign_keys

Function set_foreign_keys 

pub fn set_foreign_keys(
    conn: &Connection,
    posture: ForeignKeys,
) -> Result<(), ReplicaError>
Expand description

Put conn in posture and verify it took.

PRAGMA foreign_keys is a no-op inside a transaction — SQLite silently ignores it rather than failing — so a caller that ran it at the wrong moment would otherwise get the opposite posture with no error at all. Every opener here sets it on a fresh connection before any transaction, and reading it back is what keeps that a fact rather than an assumption.