sqlite-integrity-check · shipping · also PRAGMA integrity_check

SQLite integrity_check

SQLite integrity_check examines database structure and selected constraints without checking foreign-key relationships.

Related Observatory article: Read on hesela.com

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

  1. SQLite PRAGMA integrity_check (accessed 2026-10-17)
  2. Hesela: executed SQLite validation-boundary cases (accessed 2026-10-17)
  3. Hesela: supplemental legacy generated-value controls, exact builds and RO/RW checks (accessed 2026-11-03)
  4. Hesela: recovery-copy distinctions for STORED values and VIRTUAL indexes (accessed 2026-11-03)
  5. SQLite aggregate functions: non-NULL populations and indeterminate signed-infinity sums (accessed 2026-11-06)
  6. Hesela: native telemetry observations, versions, evidence pointers and limits (accessed 2026-11-06)
  7. Hesela: offline SQLite telemetry replay package and source ledger (accessed 2026-11-06)
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]

JSON: /data/terms/sqlite-integrity-check.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. SQLite integrity_check. Hesela. 2026-11-06. https://hesela.dev/terms/sqlite-integrity-check/