I have this code:
db.query(sets, stores).select_from(orm.join(sets, stores,\
sets.store_scheme_id == stores.store_id)).filter(sets.id == id).one()
And I have the SQL debugging level at DEBUG, so it prints out the generated SQL query before it returns. The generated SQL works fine in phpmyadmin. SQLAlchemy, however, DOESN'T work fine and returns to me an empty list (with all()
instead of one()
, naturally; one() throws an error, as expected when there isn't just a single row).
Why can't SQLAlchemy hook me up with the data when the generated SQL statement works just fine?