This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-13
Channels
- # adventofcode (36)
- # aleph (1)
- # announcements (7)
- # aws (4)
- # babashka (14)
- # beginners (61)
- # calva (79)
- # cider (19)
- # clojure (48)
- # clojure-austin (1)
- # clojure-australia (2)
- # clojure-czech (2)
- # clojure-europe (46)
- # clojure-france (8)
- # clojure-nl (19)
- # clojure-uk (4)
- # clojuredesign-podcast (14)
- # core-logic (42)
- # data-science (3)
- # datalevin (8)
- # datomic (76)
- # events (1)
- # figwheel-main (9)
- # fulcro (6)
- # helix (1)
- # holy-lambda (1)
- # honeysql (2)
- # jobs (2)
- # jobs-discuss (20)
- # leiningen (5)
- # lsp (87)
- # minecraft (11)
- # nextjournal (4)
- # off-topic (17)
- # practicalli (1)
- # reagent (22)
- # reitit (8)
- # releases (3)
- # rum (2)
- # shadow-cljs (18)
- # sql (11)
- # tools-build (5)
- # tools-deps (9)
- # xtdb (20)
@roguas That's just how the camel-snake-kebab
library works: https://clj-commons.org/camel-snake-kebab/
Thanks Sean, yeah is there easy way to provide fn to just convert one string to something predictable for me. Honestly this is a weird choice by the library, I think most people's intuition wouldnt be to modify value in this way.
It is a very considered, deliberate choice by the library. You are free to use whatever builder you want, however, to achieve whatever naming choices you want.
(this is another reason why I stick to the default behavior in next.jdbc
)
Well this is fun:
Execution error (SQLFeatureNotSupportedException) at software.amazon.timestream.jdbc.TimestreamPreparedStatement/setObject (TimestreamPreparedStatement.java:365).
Parameters are not supported.
It seems my only choice is to interpolate the SQL string before sending it off? Does next.jdbc have any support for this (truly unnecessary) situation?@danie Well, you can invoke the functions with ["SQL string"]
and have no parameters in there. Depending on what method actually threw that error, that may let you at least send SQL via that JDBC driver...
(looks like setObject()
-- so if you don't pass parameters, that should not be called)
@seancorfield I can confirm that a plain next.jdbc/execute!
works. Now I want to hugsql that query and parameterise it.
If you parameterize it, you'll cause setObject()
to be called and that is not supported by that JDBC driver (which terrifies me, to be honest: a JDBC driver that does not properly support parameterized queries is a security nightmare).
The Timestream JDBC driver is … not good. It just flat out does not support parameterized queries.
(defn interpolate-the-parameters
[sql-params]
(reduce
(fn interpolate-param
[query param]
(clojure.string/replace-first query "?" param))
(first sql-params)
(rest sql-params)))
(deftype TimestreamParameterDealing
[ds]
p/Executable
(-execute-all
[_this sql-params opts]
(p/-execute-all ds [(interpolate-the-parameters sql-params)] opts)))