Support ordering by nested columns deeper than one level in .order() #38362
Unanswered
bobbybol
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature request
Is your feature request related to a problem? Please describe.
Currently,
.order()insupabase-jsonly supports ordering by nested relations one level deep.For example:
This works as expected and orders the
customerstable globally byaccounts.full_name.However, when trying to order by a column that is more than one level deep (grandchild relation), it fails.
Example:
This does not work because
.order()does not support nested paths beyond one level.Describe the solution you'd like
It should be possible to order a parent table by a nested column at any depth of relation (not just the immediate child).
For example, the following should work:
This would order
connectionsglobally byaccounts.full_namevia thecustomersrelation.Describe alternatives you've considered
These workarounds solve the problem but add extra complexity and maintenance overhead. Native support in
.order()would be much more ergonomic and consistent with how.select()already handles nested relations.Additional context
All reactions