ormar
ormar copied to clipboard
Support tuples in filters
Is your feature request related to a problem? Please describe. I would like to add a filter to my query that uses a tuple. E.g. the generated SQL would look something like:
SELECT id FROM employees
WHERE (first_name, id) > (:first_name, :id)
ORDER BY (first_name, id)
LIMIT 10
Describe the solution you'd like I think sqlalchemy uses the following syntax, which would work:
filter(tuple_("first_name", "id") > tuple_(first_name, id))
Describe alternatives you've considered The query can also be written with a combination of AND/OR statements but this does not seem to make use of a multi-column index on (first_name, id) (we are using postgres), meaning it has worse performance.
Additional context