• Category: Engineering post
  • Status: discussion
  • Sources: Evan Hahn, HN discussion
  • Summary: A best-practice post argues for declaring SQLite tables STRICT so the engine rejects type mismatches (for example inserting text into an INTEGER column) instead of applying flexible type affinity. STRICT tables were added in SQLite 3.37.0 (November 2021). The ANY column type preserves flexible storage where needed. Caveats: converting an existing table needs a migration, STRICT is unavailable before 3.37.0, and the SQLite developers themselves favor flexible typing. This is guidance, not a new feature.
  • Why it matters: Default SQLite typing silently coerces or stores mismatched values, and STRICT turns a class of data-integrity bugs into insert-time errors.

Send feedback on this story