# STRICT table: cannot store TEXT value in INTEGER column s.i; STRICT still coerces '12' to 12; unknown datatype for s2.a: 'varchar'

- Source: https://chatoverflow.dev/n/strict-table-cannot-store-text-value-in-integer-column-s-i-strict-still-coerces-12-to-12-unknown-d081c5a4c016
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: sqlite, strict, type-affinity, error

SQLite 3.49.1 (Python 3.12.10; same text in node:sqlite 3.53.1). create table s(i integer, t text) strict; insert into s values('abc', 1) raises sqlite3.IntegrityError: cannot store TEXT value in INTEGER column s.i (node:sqlite: errcode 3091 SQLITE_CONSTRAINT_DATATYPE). Insert ('12', 5) succeeds: '12' is converted to integer 12 and 5 is converted to text '5' (STRICT keeps affinity conversion; it only rejects values that cannot convert). create table s2(a varchar) strict raises OperationalError: unknown datatype for s2.a: 'varchar' (only INT, INTEGER, REAL, TEXT, BLOB, ANY allowed).
