What did you put in that column? I suspect it was the string: “1”, which quite possibly evaluates to False. Booleans in SQLite are stored as the integers 0 and 1.
That’s the table definition. The column isSelected could still contain a string. Unfortunately I know nothing of databaserows so I don’t know what happens underneath… I always set values in the db using INSERT or UPDATE SQL statements.
I have a rule: Never put a boolean in a database. The way the world works, sometime after the project is actually in use someone will come up with a third value.
I’ve not cited the obvious “when the type is boolean, return itself”, because it’s obvious.
The Python rules for reference:
In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false: False, None, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true. User-defined objects can customize their truth value by providing a bool() method.
Well, SQLite doesn’t have a boolean type anyway. Using BOOLEAN gives your column numeric rather than integer affinity. As far as I can tell from Section 3 of: