Fork me on GitHub
#sql
<
2021-08-28
>
kirill.salykin07:08:29

Hi, I am trying to implement support of postgresql composite types with clojure.java.jdbc and PGJDBC-NG driver (https://impossibl.github.io/pgjdbc-ng/docs/current/user-guide/) I am following default example from psql guide https://www.postgresql.org/docs/current/rowtypes.html and I am trying to use SQLData from the jdbc https://impossibl.github.io/pgjdbc-ng/docs/current/user-guide/#_java_sql_sqldata

(deftype item-dto []
    java.sql.SQLData
    (getSQLTypeName [this] "item")
    (readSQL [this stream type-name]
      {:name (.readString stream)
       :supplier_id (.readInt stream)
       :price (.readBigDecimal stream)})
    (writeSQL [this stream]))
but, it seems not working for, item-dto is not being recognised maybe someone has experience with it? what i am doing wrong?

Alister Lee10:08:30

In next.jdbc, is there a way to do this? (jdbc/execute! conn ["select 1 in ?" [1 2 3]]) meaning (jdbc/execute! conn ["select 1 in (1,2,3)"]) Thanks!