Closed vincent-dm closed 8 years ago
@vincent-dm Yes, you are right, this is missing at the moment. I added ORDER BY support for aggregate expressions over here: https://github.com/r0man/sqlingvo/pull/53 Let me know if this solves your problem, and I'll merge this.
Note, support for FILTER and WITHIN GROUP is still missing as described here: https://www.postgresql.org/docs/current/static/sql-expressions.html#SYNTAX-AGGREGATES
Thanks for the lightning-quick response, @r0man
I'd like to test it immediately, but I've never loaded a specific git-commit in my project.clj before. Should I use something like https://github.com/tobyhede/lein-git-deps or are there a better way?
@vincent-dm I usually clone a project project I want to test, switch to that branch, install the jar locally and then use the version from my local maven cache.
However, I just pushed a snapshot to Clojars, so just try 0.8.14-SNAPSHOT
in your project.clj
I haven't used lein-git-deps
, maybe that's also a fine option.
@r0man: I tested it, and it works like a charm.
Thank you. I couldn't hope for better support than this.
@vincent-dm Thanks for the confirmation, I released this as 0.8.14
.
Hi,
Working with sqlingvo has been great, but I stumbled upon a situation that I think is not supported.
When using
arrag_agg
orjson_agg
, postgres allows you to add anORDER BY
clause before the closing parenthesis to make sure the aggregated data are in the right order. (MySQL uses the same notation in itsgroup_concat
function)However, when I try this with sqlingvo, a comma gets added before the
ORDER BY
clause, resulting in a syntax error.I'm pretty new to Clojure, so forgive me for not being able to propose a pull request, but based on issue #22 it seems like this might be fixed by creating some kind of exception for code within an
arrag_agg
orjson_agg
?Would be great if this would be added at some point, but in any case I want to thank the maintainer(s) for all their time invested in building this library!