This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-24
Channels
- # announcements (3)
- # aws (5)
- # babashka (10)
- # beginners (61)
- # calva (22)
- # clara (9)
- # clj-kondo (8)
- # cljdoc (8)
- # cljsrn (15)
- # clojure (44)
- # clojure-australia (2)
- # clojure-europe (31)
- # clojure-hungary (20)
- # clojure-nl (5)
- # clojure-uk (3)
- # core-logic (2)
- # cursive (2)
- # data-science (2)
- # datalevin (4)
- # datascript (6)
- # datomic (17)
- # defnpodcast (1)
- # figwheel-main (1)
- # fulcro (18)
- # graalvm (2)
- # introduce-yourself (2)
- # jobs (1)
- # jobs-discuss (59)
- # lsp (44)
- # music (1)
- # nrepl (2)
- # off-topic (26)
- # pedestal (2)
- # re-frame (12)
- # reagent (27)
- # releases (1)
- # remote-jobs (4)
- # rewrite-clj (2)
- # sci (12)
- # shadow-cljs (12)
- # sql (10)
- # uncomplicate (6)
- # vim (12)
- # xtdb (2)
In next.jdbc
is there a way to use next.jdbc/with-options
along with next.jdbc/component
? I know that component
accepts a db-map and not a ds.
For now, I just have my own domain functions that wrap execute!
and execute-one!
, passing whatever options I want.
I really wish I'd never added with-options
😞
@seancorfield from https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.2.761/doc/getting-started/prepared-statements:
(with-open [con (jdbc/get-connection ds)]
(with-open [ps (jdbc/prepare con ["..." ...])]
(jdbc/execute-one! ps nil {...})))
is the nesting necessary? Cannot you write
(with-open [con (jdbc/get-connection ds), ps (jdbc/prepare con ["..." ...])]
(jdbc/execute-one! ps nil {...}))
?You mean, like the next example on that page shows?
;; assuming require next.jdbc.prepare :as p
(with-open [con (jdbc/get-connection ds)
ps (jdbc/prepare con ["..."])]
(jdbc/execute-one! (p/set-parameters ps [...])))
The docs are showing two possible ways to use with-open
.☝️:skin-tone-2: @holyjak
Ah, you are 💯 right. I should have seen that. Sorry!
I replied to that issue you opened about execute-batch!
-- did you get a chance to try that yet @holyjak?
I see it but not yet, hope soon..