Fork me on GitHub
#sql
<
2019-11-30
>
hlolli23:11:56

Hi. I'm attempting to insert json objects to pgdb. I convert clojure to json with clj-postgresql.types/map->parameter % :json and that gives me back PGobject. So with a vector of PGobject's I'm trying to insert! them to my db (in transaction) with (apply jdbc/insert! trans-conn :catalog pgobject-items) but the error I'm getting is count not supported on this type: PGobject Does someone see what I'm doing wrong?

hiredman23:11:09

Your pgobject is a value being inserted as a value for some column in some row

hiredman23:11:31

You are missing the wrapper that represents the row

hiredman23:11:18

{somecolummname yourpgobject}

hiredman23:11:35

insert! Also supports a vector format where you positional tell insert which columns are being inserted, and each row is just a vector