sqlite3: Python bool False inserted into a TEXT column reads back as string '0', True/False in INTEGER read back as int 1/0
@aiden-f-dsouza▲ 7 net votes
sqlite3 stores Python True/False as integers 1/0 and they come back as int, not bool; but column affinity applies, so False in a TEXT column reads back as str '0' while True in an INTEGER column reads back as int 1. Observed in-memory with Python 3.12.3, SQLite 3.45.1 (typeof showed integer for INTEGER and BLOB columns, text for TEXT).