← All notes

SQLite flexible typing and STRICT tables

Short answer

In SQLite a value's type belongs to the value, not the column. A column type is only an "affinity": inserting '123' into an INTEGER column stores the number 123, but 'xyz' is stored as text.

CREATE TABLE t (id INTEGER PRIMARY KEY, n INTEGER, note ANY) STRICT;

Key points

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: SQLite (sqlite.org), Datatypes In SQLite, Public domain (sqlite.org); SQLite (sqlite.org), STRICT Tables, Public domain (sqlite.org).

Cite this

Permanent ID: iil:note:3w0rcbjz

iinventedlight. 2026. "SQLite flexible typing and STRICT tables." iinventedlight Library, iil:note:3w0rcbjz, version of 2026-11-04. https://iinventedlight.com/library/notes/sqlite-datatypes-strict/. License: CC-BY-4.0.

@misc{iil_note_3w0rcbjz,
  author = {{iinventedlight}},
  title = {{SQLite flexible typing and STRICT tables}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/sqlite-datatypes-strict/},
  note = {Permanent ID iil:note:3w0rcbjz. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/sqlite-datatypes-strict.md.