-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Array aggregate with ORDER BY clause #2094
Comments
coleifer
added a commit
that referenced
this issue
Jan 24, 2020
The method you're describing is an acceptable way of handling this. I'm going to pass on implementing a fix right now, but may reconsider it later. |
coleifer
added a commit
that referenced
this issue
Jan 25, 2020
I've decided to fix, but opted for a slightly hacky way of doing this. Instead of copying the NodeList() hack to avoid double-wrapping expressions in parentheses, I've chosen to modify the last argument in-place to extend it with ordering information. Fixes #2094
Actual fix is now in: fe84246 |
That's awesome! Thanks for the quick response (and implementing the feature!). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Postgresql supports ordered array aggregation in the form of:
ARRAY_AGG(expression [ORDER BY [sort_expression {ASC | DESC}], [...])
The way I currently implement it:
Do you happen to know a nicer way of implementing array_agg's order by clause using peewee? If not, would you be willing to accept a PR that adds a function that adds this functionality to f.e. playhouse.postgres_ext?
The text was updated successfully, but these errors were encountered: