In a database table I have a column defined as:
Using this query:
query = text(
"SELECT * FROM %s
WHERE " % "aTable"
"%s=%s AND " % ("done", 0)
)
result = engine.execute(query)
row = result.fetchone()
when I call print row['done'] then I get '\x00'.
For generation of tables I sqlacodegen which generated the done columns as this:
Column('done', BIT(1), nullable=False),
Am I missing some configuration in SqlAlchemy? I don't want to convert the hex to int everywhere I am goint to use a BIT column.
EDIT So the problem is not with sqlalchemy but it seems that pymysql is to blame.