I need to use the PostgreSQL only clause in a select query. Can I do that with SQLAlchemy?
Yes, provided you use SQLAlchemy version 0.8.0 o newer (see issue 2506).
The ONLY
keyword is implemented as a select hint:
result = table.select().with_hint(table, 'ONLY', 'postgresql')
or when using the ORM layer, on on a query object with:
session.query(...).with_hint(MappedClass, 'ONLY', 'postgresql')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With