@seancorfield just as FYI you :extend-with-metadata
trick in the latest clojure.java.jdbc
worked like a charm and this is what I am doing (among other things):
(defn- cast-state-param
[value]
(with-meta
(fn []) ;; meta can only added to clojure objects
{`clj-jdbc/set-parameter
(fn [_ ^PreparedStatement stmt ^long i]
(.setObject stmt i value Types/OTHER))}))
@richiardiandrea Cool! With next.jdbc
, you'd just be able to call next.jdbc.types/as-other
instead of needing to write your own cast function 🙂
Yeah that sounds like a better approach 😃