Implement order/then_order_by for combination clauses (Union, …) #4246
Aethelflaed
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I fear that's currently not easily possible as the "subqueries" could have different select expressions with different field types. Making that possible would require a considerable amount of design work and likely some other features like What should be relatively easy to implement is the fix for |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Postgres, mysql and sqlite all support ordering a combination query.
We could allow this by implementing
OrderDsl
/ThenOrderDsl
forCombinationClause
.From what I understand, it would need to verify that the order's
expr
is valid for a given query source (as it's only implemented forSelectStatement<FromClause<F>, ...>
).It seems possible to mimic this constraint by implementing the traits only if the combinator's
Source
orRhs
is a query source (in which case the combinator itself becomes a query source)I'm keen on working on that after #3084 if the idea is sound
Beta Was this translation helpful? Give feedback.
All reactions