I have a table from schema "test":
class AttributeConversion(Base):
__tablename__ = 'test.attribute_conversion'
How to select records from this table?
SQLAlchemy generates SQL:
select * from "test.attribute_conversion"
But it doesn't work. The correct query must be:
select * from test.attribute_conversion (without quotes)
1 Answer 1
You can explicity specify a schema name for a table:
class AttributeConversion(Base)
__tablename__ = 'attribute_conversion'
__table_args__ = {'schema' : 'test'}
See documentation on specifying the schema name.
Sign up to request clarification or add additional context in comments.