This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-25
Channels
- # aleph (9)
- # announcements (2)
- # babashka (32)
- # babashka-sci-dev (72)
- # beginners (77)
- # calva (1)
- # cider (3)
- # clj-kondo (19)
- # clojure (61)
- # clojure-brasil (13)
- # clojure-europe (25)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-norway (27)
- # clojure-uk (23)
- # clojuredesign-podcast (6)
- # clojurescript (12)
- # conjure (2)
- # core-typed (3)
- # cursive (6)
- # datalevin (2)
- # datomic (13)
- # emacs (9)
- # events (19)
- # fulcro (6)
- # graphql (11)
- # gratitude (2)
- # helix (3)
- # honeysql (16)
- # jobs (1)
- # lsp (89)
- # malli (33)
- # meander (14)
- # off-topic (87)
- # pathom (4)
- # polylith (7)
- # portal (4)
- # practicalli (1)
- # rdf (6)
- # reagent (2)
- # releases (8)
- # remote-jobs (1)
- # shadow-cljs (59)
- # sql (8)
- # tools-deps (14)
- # xtdb (18)
is there any way to tell java.jdbc
to somehow "escape" a question mark character so that it doesn't try to treat it as a parameter substitution? My use case is the ?|
JSON function in postgres:
(jdbc/query db ["select '{\"foo\": 42}'::jsonb ?| array ['foo']"])
=>
Unhandled org.postgresql.util.PSQLException
No value specified for parameter 1.
@skuro that exception is from JDBC - this is not a java.jdbc
issue : it's a sql/jdbc issue in general. So the answer is "however JDBC requires that you escape a question mark"
yep, I was actually reaching that conclusion:
(def _c (jdbc/get-connection db))
(def _p (.prepareStatement _c "select '{\"foo\": 42}'::jsonb ?| array ['foo']"))
(def _x (.executeQuery _p))
=>
same exception
(I bet the PG docs have an answer - but I don't use PG)
(and m on my phone)
https://github.com/seancorfield/next-jdbc/issues/203 so at least others can find that in the docs in future.
1