For people using next.jdbc with Postgres, am I doing this right?
(next.jdbc/execute! ds
["select id from profiles where id = ANY(?)"
(into-array ["id1" "id2"])])
Can I somehow do without the into-array
call?I got the ANY(?)
trick https://cljdoc.org/d/seancorfield/next.jdbc/1.1.613/doc/getting-started/tips-tricks#postgresql, and I found I can extend next.jdbc.prepare/SettableParameter
to clojure.lang.IPersistentVector
to make it so that I don't have to type into-array
every time, but it still happens underneath...
@jaihindhreddy The PG driver needs a Java array, not a Clojure vector, so I don't think you can get away from having that somewhere in the call stack.
if you don't extend vectors to be interpreted as json, you can make them auto convert to arrays
you need an array at some point in the callstack, yes
but you can make it implicit if you really want to