This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-19
Channels
- # announcements (19)
- # asami (9)
- # babashka (26)
- # beginners (87)
- # biff (23)
- # calva (6)
- # clerk (7)
- # clj-kondo (3)
- # cljsrn (3)
- # clojure (115)
- # clojure-belgium (1)
- # clojure-berlin (1)
- # clojure-europe (31)
- # clojure-gamedev (5)
- # clojure-nl (2)
- # clojure-norway (8)
- # clojure-uk (2)
- # clojurescript (43)
- # clr (23)
- # datalevin (1)
- # datomic (14)
- # dev-tooling (23)
- # fulcro (38)
- # graphql (1)
- # gratitude (1)
- # jobs (1)
- # lsp (30)
- # off-topic (7)
- # pathom (25)
- # portal (21)
- # quil (6)
- # releases (5)
- # remote-jobs (1)
- # shadow-cljs (34)
- # sql (5)
- # tools-deps (6)
- # xtdb (13)
Hi trying to use Migratus with mysql and getting the following error
; Execution error (ClassCastException) at next.jdbc.prepare$eval3909$fn__3910/invokePrim (prepare.clj:40).
; class com.mysql.cj.jdbc.ConnectionImpl cannot be cast to class java.sql.PreparedStatement (com.mysql.cj.jdbc.ConnectionImpl is in unnamed module of loader 'app'; java.sql.PreparedStatement is in module java.sql of loader 'platform')
this happened on one machine but not another. does anyone have an idea what to do?When I use next.jdbc/execute
I can pass {:builder-fn my-custom-builder-fn}
opts where my-custom-builder-fn
receives a java.sql.ResultSet
.
Is there any way to somehow pass in a :builder-fn
opts when I use create a preparedstatement and pass that to jdbc/plan
?
(with-open [stmt (jdbc/prepare conn pg-query {:fetch-size 750
:result-type :forward-only
:concurrency :read-only})]
(->> (jdbc/plan stmt)
...)
perhaps I need to skip calling jdbc/plan
and instead call (p/-execute stmt ... {:builder-fn ...})
directly?
it does look like that does what I want. writing out the question helped me answer it myself, I guess
Why are you creating the PeparedStatement? Why not just call plan
with the conn
and those options + plus :builder-fn
?