Hi! I'm trying to insert data into a postgres table with a jsonb column like this:
(sql/run! (-> (h/insert-into :my_table)
(h/values [{:user_id 1
:my_jsonb_col [:lift {:title "Epic Battle"}]}])))
However, when running it, I get an error about no hstore extension installed. Do I manually need to convert it to json, different from what https://github.com/seancorfield/honeysql/blob/develop/doc/postgresql.md#jsonjsonb states?HoneySQL just creates SQL queries. It doesn't attempt to understand the underlying DB types - that's the job for JDBC. In this case, a relevant section would be https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.939/doc/getting-started/tips-tricks?q=json#working-with-json-and-jsonb
This is because by default, PG JDBC encodes java.util.Map instances into the hstore type, which is a map of String->String. Please refer to the link shared above and extend protocols with PersistentMap/PGObject types
Ah, thanks! I somehow assumed honey does the conversion, too..