Hello! I'm trying to set up automatic Clojure maps <-> org.postgresql.util.PGobject conversion for a JSON column. I found [1], which seems to work with clojure.java.jdbc, but not jdbc.next. Is there anything like clojure.java.jdbc/ISQLParameter
in jdbc.next?
[1]: https://github.com/remodoy/clj-postgresql
(extend-protocol next.jdbc.result-set/ReadableColumn
java.sql.Array
(read-column-by-label [^java<.sql.Array v label]
(sql-array->java v))
(read-column-by-index [^java.sql.Array v rs-meta idx]
(sql-array->java v)))
(extend-protocol next.jdbc.prepare/SettableParameter
java.time.Instant
(set-parameter [^java.time.Instant v ^java.sql.PreparedStatement ps ^long i]
(.setTimestamp ps i (java.sql.Timestamp/from v)))
java.util.Date
(set-parameter [^java.time.Instant v ^java.sql.PreparedStatement ps ^long i]
(.setTimestamp ps i (java.sql.Timestamp/from v))))
first protocol is when you get values out of postgres, second procotol is when you set values in statements
Great, thanks!