Seemingly more idiomatic use of aggregate clause by preventing aliasing in defhelper instead of by destructuring in formatter.

This commit is contained in:
Menthalion 2014-08-18 23:00:05 +02:00
parent bdeb95d956
commit 41095d18ce
2 changed files with 2 additions and 2 deletions

View file

@ -393,7 +393,7 @@
(defmethod format-clause :over [[_ part-clause] _] (defmethod format-clause :over [[_ part-clause] _]
(str "OVER " (to-sql part-clause))) (str "OVER " (to-sql part-clause)))
(defmethod format-clause :aggregate [[_ [aggregate-fn _]] _] (defmethod format-clause :aggregate [[_ aggregate-fn] _]
(str (to-sql aggregate-fn))) (str (to-sql aggregate-fn)))
(defmethod format-clause :partition-by [[_ fields] _] (defmethod format-clause :partition-by [[_ fields] _]

View file

@ -228,7 +228,7 @@
(update-in m [:over] (partial apply merge) (collify fields))) (update-in m [:over] (partial apply merge) (collify fields)))
(defhelper aggregate [m aggregate-fn] (defhelper aggregate [m aggregate-fn]
(assoc m :aggregate aggregate-fn)) (assoc m :aggregate (first aggregate-fn)))
(defhelper spartition-by [m fields] (defhelper spartition-by [m fields]
(assoc m :partition-by (collify fields))) (assoc m :partition-by (collify fields)))