{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-07",
  "slug": "sqlite-strict-table",
  "term": "SQLite STRICT table",
  "aliases": [
    "STRICT typing"
  ],
  "definition": "A SQLite STRICT table enforces a restricted set of column types after permitted coercions, while its ANY columns preserve the received value and type without coercion.",
  "note": "STRICT is a per-table option available since SQLite 3.37.0. Ordinary ANY can convert numeric-looking text; STRICT ANY does not. Preservation concerns the value actually bound, not earlier source data. [strict]\n\nOn SQLite 3.45.1, a controlled decimal-point text input lost one unit when inserted into STRICT INTEGER. Text bound into STRICT ANY remained text, but a Python float already rounded before binding remained rounded. Exact numeric equality with the source must be tested separately from type validity. [experiment]\n\nNaN before the column: in controlled Python SQLite 3.45.1 and 3.53.1 runs, bound floating-point NaN became SQL NULL even in STRICT ANY. A direct C API control on system SQLite 3.45.1 observed the conversion without a table. The pinned upstream value setter explains the mechanism; it is not an identity claim about the installed binaries. Text-bound NaN remained TEXT, a different input representation. [nan-setter] [telemetry-evidence]\n\nPresence and domain are separate: a NULL-valued CHECK is nonviolating. NOT NULL rejected the converted NaN, but NOT NULL with a nonnegative check still admitted positive infinity in the fixture. Classify invalid versus absent readings before binding and retain that status when the distinction matters; neither STRICT nor a later count reconstructs it. These are selected software controls, not drive-fleet observations. [check-null] [telemetry-evidence] [telemetry-replay]\n\nSelf-comparison trap: IEEE NaN is unequal to itself, as Goldberg explains. SQL CHECK(x = x) is not the same test: the retained NaN binding became NULL, whose check passes. Classify before binding; floating-point comparison rules do not survive that conversion. [goldberg-nan] [nan-setter] [check-null] [telemetry-evidence]",
  "related": [
    "sqlite-type-affinity",
    "sqlite-integrity-check",
    "backup-verification"
  ],
  "citations": [
    {
      "id": "strict",
      "title": "SQLite: STRICT Tables, sections 2 and 3",
      "url": "https://www.sqlite.org/stricttables.html",
      "accessed": "2026-10-20"
    },
    {
      "id": "experiment",
      "title": "Hesela: exact source values and STRICT import controls",
      "url": "https://hesela.com/analyses/sqlite-import-numeric-precision/#conversion",
      "accessed": "2026-10-20"
    },
    {
      "id": "nan-setter",
      "title": "SQLite 3.45.1 upstream sqlite3VdbeMemSetDouble: NaN remains NULL",
      "url": "https://raw.githubusercontent.com/sqlite/sqlite/189e44dfecdc7868bb860dfb5d98eab371318c37/src/vdbemem.c",
      "accessed": "2026-11-06"
    },
    {
      "id": "check-null",
      "title": "SQLite CREATE TABLE: CHECK and NOT NULL constraints",
      "url": "https://www.sqlite.org/lang_createtable.html#checkconst",
      "accessed": "2026-11-06"
    },
    {
      "id": "telemetry-evidence",
      "title": "Hesela: native telemetry observations, versions, evidence pointers and limits",
      "url": "https://hesela.dev/research/sqlite-telemetry-provenance/summary.json",
      "accessed": "2026-11-06"
    },
    {
      "id": "telemetry-replay",
      "title": "Hesela: offline SQLite telemetry replay package and source ledger",
      "url": "https://hesela.dev/research/sqlite-telemetry-provenance/package.zip",
      "accessed": "2026-11-06"
    },
    {
      "id": "goldberg-nan",
      "title": "Goldberg (1991), What Every Computer Scientist Should Know About Floating-Point Arithmetic: NaNs and comparisons (authorized reprint)",
      "url": "https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html",
      "accessed": "2026-11-07"
    }
  ],
  "provenance": [
    "Primary-source definition and controlled Python 3.12.3 / SQLite 3.45.1 observations. No claim that all engine versions were tested.",
    "Telemetry evidence is a controlled two-runtime experiment. The separately linked C control uses SQLite 3.45.1 in both captures. It does not revise the existing SMART missingness audit or establish incidence across builds. [telemetry-evidence]"
  ]
}
