SQLite foreign_key_check
SQLite foreign_key_check reports violations of foreign-key references declared in a database schema.
Validation and enforcement are separate operations. Enabling foreign_keys inside a transaction does not change enforcement; query its effective value outside the transaction. [1]
A nullable reference can contain NULL without violating its foreign key. A reference to an unintended but existing parent also passes the measured schema while failing the fixture's owner requirement. [2] [3]
Relations
- related
- sqlite-integrity-check, backup-verification, sqlite-online-backup
Citations
- SQLite PRAGMA foreign_keys and foreign_key_check
- SQLite Foreign Key Support
- Hesela: executed SQLite validation-boundary cases
Sources & caveats
- Ten designed cases using SQLite 3.45.1 with DELETE/WAL sources and read-only reopened destinations; no crash, failure-rate or full-application recovery claim.
Published by Hesela team · Updated
Report a correction · Editorial standards · Reuse guidance
Cite this page
Hesela team. SQLite foreign_key_check. Hesela. 2026-10-17. https://hesela.dev/terms/sqlite-foreign-key-check/