-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting by a calculation that performs a subquery raises an error #262
Comments
Interesting...so I was originally thinking that this was a postgres limitation, but upon further research it isn't. However, I'll need to see why Ecto doesn't allow this. If it is just work that hasn't been done then we'll fix it in ecto instead of patching it on our end by moving the value to the select and referencing that. |
Relevant mailing list conversation: https://groups.google.com/g/elixir-ecto/c/tgKNosEtyzI |
This will be resolved when this is merged elixir-ecto/ecto#4417 (or something like it is merged). I'm going to close this issue for now, and will track the issue in the ecto issue. Updating ecto at some point will resolve the issue. |
Thanks Zach! That'll be a killer feature 💪 |
eg.
Artist
resource has a calculationfollowed?
, defined like:Attempting to sort a query reading artists by this calculation, like:
Raises the following error:
Notes
exists
in anorder_by
then we need to move the calculation into the select and then sort on the selected nameRuntime
The text was updated successfully, but these errors were encountered: