This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-26
Channels
- # architecture (2)
- # beginners (310)
- # boot (34)
- # cider (50)
- # cljs-dev (82)
- # cljsrn (1)
- # clojure (125)
- # clojure-dusseldorf (1)
- # clojure-hamburg (1)
- # clojure-italy (47)
- # clojure-russia (21)
- # clojure-spec (38)
- # clojure-uk (36)
- # clojurescript (200)
- # community-development (21)
- # cursive (10)
- # datomic (15)
- # duct (58)
- # emacs (20)
- # fulcro (10)
- # funcool (1)
- # graphql (2)
- # hoplon (6)
- # jobs (1)
- # lumo (12)
- # mount (20)
- # off-topic (14)
- # om (5)
- # portkey (43)
- # protorepl (2)
- # re-frame (31)
- # reagent (36)
- # ring (17)
- # ring-swagger (6)
- # shadow-cljs (50)
- # spacemacs (9)
- # sql (5)
- # tools-deps (28)
- # uncomplicate (4)
- # unrepl (5)
- # vim (2)
- # yada (2)
So this might come off as a dumb question (perhaps I’m just failing at my google fu), but is there a way to parameterize for multiple rows? Basically I have
INSERT INTO foo (a, b, c)
VALUES -- looking what to put here for parameterizing multiple rows
ON CONFLICT
-- a bunch of other stuff not supported by my ORM
Do I need to make code to generate n number of (?, ?, ?)
rows to insert into the prepared statement?
@bwstearns does this work ((?, ?, ?), (?, ?, ?))
? or (?, ?, ?), (?, ?, ?)
@bwstearns correct, using the raw sql strings there's no way to do that. http://clojure.github.io/java.jdbc/#clojure.java.jdbc/insert-multi! attempts to make it so you don't need to do that, but as far as I know that won't work with on conflict
. For queries like this either you need to generate n
number of (?, ?, ?)
rows, or use a helper library (like hugsql or honeysql).
I personally think things like this are easier done with honeysql