This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-21
Channels
- # announcements (10)
- # aws (38)
- # beginners (220)
- # calva (2)
- # cider (26)
- # clj-kondo (194)
- # cljs-dev (4)
- # clojure (190)
- # clojure-dev (7)
- # clojure-europe (3)
- # clojure-italy (6)
- # clojure-nl (4)
- # clojure-uk (8)
- # clojured (1)
- # clojurescript (29)
- # code-reviews (31)
- # community-development (9)
- # core-async (24)
- # cursive (38)
- # data-science (51)
- # datomic (52)
- # dirac (2)
- # emacs (3)
- # events (1)
- # figwheel-main (4)
- # fulcro (49)
- # graphql (13)
- # heroku (1)
- # hoplon (19)
- # immutant (3)
- # leiningen (1)
- # nrepl (59)
- # off-topic (12)
- # onyx (2)
- # pathom (51)
- # reitit (15)
- # shadow-cljs (88)
- # spacemacs (6)
- # sql (3)
- # tools-deps (107)
- # xtdb (11)
@vachichng thanks
I am trying to generate sql for an update
with a sub query
. honesql generates the following -
"UPDATE sample SET available = FALSE FROM (SELECT id from sample where colour = red), AS subquery WHERE sample.id = subquery.id"
The problem is the ,
after the subquery, how do I get rid of it.
My honesql -
(-> (helpers/update :sample)
(helpers/sset {:available false})
(helpers/from (find-sample-honesql m) (sql/raw "AS subquery"))
(helpers/where [:= :sample.id :subquery.id])
sql/format)
You should be able to just provide an alias directly in from
:
(helpers/from [(find-sample-honesql m) :subquery])
Does that not work @murtaza52?