How can I represent this query in SQLAlchemy?
SELECT COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'foo'
Mb, I didn't understood you meant the database types. If it's a mapped table you can iterate columns like this:
for c in foo.__table__.columns:
print(c.type)
foo.