- attached sqlite_bug.py
Boolean PassiveDefault('f') columns don't get default values under SQLite
Issue #1296
resolved
Setting a PassiveDefault('f') on a Boolean column works under PostgreSQL. But under SQLite, new objects have that column incorrectly set to True. See the attached test case.
I'm using: SQLAlchemy 0.5.2 SQLite 3.6.9
Comments (3)
-
Account Deleted -
repo owner - changed status to invalid
The
PassiveDefault
correctly assigns a default value off
to the column, where in SQLite there is no real "boolean" datatype - an INSERT into this table populates the column with the string valuef
.The
Boolean
datatype in SQLAlchemy when applied to SQLite uses1
and0
for true/false values. So you should specify the value1
withPassiveDefault
in conjunction with SQLite.PassiveDefault
is not intended to be backend agnostic. -
repo owner - removed milestone
Removing milestone: 0.5.xx (automated comment)
- Log in to comment
test to demonstrate the bug