summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md
index d29cb5f..4eed172 100644
--- a/README.md
+++ b/README.md
@@ -210,6 +210,29 @@ be the return value of the associated query function call (`deref`,
### 0.2.0
+* **Breaking:** `group` has changed significantly. It now takes a third
+ argument which is an 'auxiliary projection'. The fields in the
+ resulting query will be the union of the grouped fields and the
+ projection (with the projection taking precedence). Each value in
+ the projection must be, in some way, an aggregate of the grouped
+ values (this is not, and cannot really be, enforced, but we try to
+ warn you if you're obviously wrong).
+
+ :::clojure
+ (-> (q/table :users)
+ (q/project [:age :name])
+ (q/group [:age] {'(string_agg :name ",") :names}))
+ ;=> ["SELECT \"users1785\".\"age\" AS \"age\", (\"string_agg\"(\"users1785\".\"name\",?)) AS \"names\"
+ FROM \"users\" AS \"users1785\"
+ GROUP BY \"users1785\".\"age\""
+ ","]
+
+ (-> (q/table :users)
+ (q/project [:age :name])
+ (q/group [:age] {:name :name}))
+ ;=> Exception! Expr is not a function application - could not
+ possible be an aggregate
+
* **Breaking:** Remove `having`, use `select` instead now
* `sort` can now sort on expressions, not just table names