{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-20",
  "slug": "sqlite-type-affinity",
  "term": "SQLite type affinity",
  "aliases": [
    "column affinity"
  ],
  "definition": "SQLite type affinity is a column's preference for a storage class, which can cause values to be converted when inserted or compared.",
  "note": "Numeric affinity can convert numeric-looking text to INTEGER or REAL. The declared column type and the actual storage class are separate properties. Preserve a source representation when its exact spelling or decimal value matters. [affinity]\n\nIn a controlled SQLite 3.45.1 matrix, text 9007199254740993.0 became integer 9007199254740992 in NUMERIC and STRICT INTEGER columns, while the digit-only string and exact integer binding preserved the intended integer. Completed backup and integrity checks retained the converted values. [experiment]",
  "related": [
    "sqlite-strict-table",
    "sqlite-integrity-check",
    "sqlite-online-backup"
  ],
  "citations": [
    {
      "id": "affinity",
      "title": "SQLite: Datatypes, numeric affinity and storage classes",
      "url": "https://www.sqlite.org/datatype3.html",
      "accessed": "2026-10-20"
    },
    {
      "id": "experiment",
      "title": "Hesela: SQLite import precision experiment",
      "url": "https://hesela.com/analyses/sqlite-import-numeric-precision/",
      "accessed": "2026-10-20"
    }
  ],
  "provenance": [
    "Definition from SQLite documentation; observations from 75 designed insert attempts, not a population study."
  ]
}
