SQLite integrity_check
SQLite integrity_check examines database structure and selected constraints without checking foreign-key relationships.
A result of ok does not validate declared references or application meaning. Use a separate foreign_key_check for declared relationships. [1]
Ten completed backup fixtures preserved all source rows and returned ok; four retained orphan references and only two met the fixed owner requirement. These are deliberately constructed inputs, not naturally occurring backup failures. [2]
In supplemental two-build legacy-file controls, an internally consistent index on a stale STORED hex(payload) value passed full checks through both read-only and read/write connections. An explicit stored IS NOT hex(payload) predicate found the mismatch. This is not the indexed VIRTUAL case, where full checking detects a stale index, nor evidence that all constraints are unchecked. Upgrading a writer and accepting inherited application values are different tasks. [3] [4]
Telemetry: a completed backup retained NULL for both bound NaN and absence, while reopened databases passed integrity_check. Four rows had two non-NULL values: AVG returned 20 ms for those two values. COUNT(x) cannot recover missingness reasons. A pre-binding status field retained them, without proving the classification correct. [6]
Partial sums: in a signed-infinity control, direct SUM returned NULL but explicitly summing group subtotals returned 10. The outer aggregate skipped the indeterminate subtotal. Preserve contributing counts and invalid/empty/valid state. [5] [6] [7]
Relations
- related
- SQLite foreign_key_check, Backup verification, SQLite Online Backup API, SQLite quick_check, SQLite expression index, FTS5 integrity-check, SQLite RTree, SQLite generated column
Citations
- SQLite PRAGMA integrity_check
- Hesela: executed SQLite validation-boundary cases
- Hesela: supplemental legacy generated-value controls, exact builds and RO/RW checks
- Hesela: recovery-copy distinctions for STORED values and VIRTUAL indexes
- SQLite aggregate functions: non-NULL populations and indeterminate signed-infinity sums
- Hesela: native telemetry observations, versions, evidence pointers and limits
- Hesela: offline SQLite telemetry replay package and source ledger
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.
- Supplemental fixed two-row legacy files, six recovery actions, two recorded reader builds and two closed source journal configurations: 24 outcomes, explicit RO/RW checks. Same-host corroboration of earlier evidence, not independent replication, incidence or a crash test.
- Additional telemetry observations use Python SQLite 3.45.1 and 3.53.1 on selected inputs, not a random sample. No physical device, power-loss event or concurrent writer was tested; the Backblaze audit is unchanged. [6]
- The signed-infinity control is not a valid latency workload, an optimizer-rewrite claim or a general summation guarantee. [6]