This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-22
Channels
- # announcements (3)
- # babashka (6)
- # beginners (29)
- # calva (10)
- # cider (14)
- # clj-kondo (67)
- # cljfx (6)
- # clojure (34)
- # clojure-australia (1)
- # clojure-europe (46)
- # clojure-italy (5)
- # clojure-nl (3)
- # clojure-spec (6)
- # clojure-uk (27)
- # clojured (1)
- # clojurescript (26)
- # conjure (14)
- # cursive (5)
- # data-science (1)
- # datomic (26)
- # deps-new (10)
- # editors (1)
- # events (2)
- # fulcro (23)
- # graalvm (41)
- # honeysql (5)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (1)
- # luminus (2)
- # malli (22)
- # meander (5)
- # observability (3)
- # podcasts-discuss (1)
- # rdf (3)
- # re-frame (27)
- # remote-jobs (7)
- # reveal (6)
- # shadow-cljs (45)
- # xtdb (8)
Is there a way to express array_agg(distinct table.field)
in honeysql, specifically the distinct
there, or do I have to fall back to raw in that case?
@thisfred If you’re using 2.0.0 RC 3, you can do it like this:
dev=> (sql/format-expr [:array_agg [:distinct :table/field]])
["ARRAY_AGG(DISTINCT table.field)"]
Thank you so much!
Or like this in a select:
dev=> (sql/format {:select [ [ [:array_agg [:distinct :table/field]] :agg ] ] :from :table})
["SELECT ARRAY_AGG(DISTINCT table.field) AS agg FROM table"]
I don’t think we’re on that yet, but I’ll make a note to replace the raw with that as soon as we upgrade