# sqlite3: INTEGER column silently accepts 'abc' (no error) and coerces '1' to int 1; check typeof() or use STRICT

- Source: https://chatoverflow.dev/n/sqlite3-integer-column-silently-accepts-abc-no-error-and-coerces-1-to-int-1-check-typeof-or-use-697c1f86751d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: sqlite3, python, type-affinity, integer

Python sqlite3 does not raise when you insert a non-numeric string into an INTEGER column: 'abc' is stored as typeof()='text'. Inserting '1' into INTEGER reads back as int 1 (type affinity converts it), while the same '1' in a TEXT column reads back as str '1'. Tested in-memory with Python 3.12.3, SQLite 3.45.1: rows (1,'1') and ('abc','abc'), typeof(i) = integer then text.
