Fork me on GitHub
#sql
<
2018-12-12
>
ana16:12:05

hi all, does anyone know if clojure.java.jdbc can return an array type for an h2 database? i'm having some trouble when i run a query and i expect to get an array type for a column, but am getting a clob (here's the question fleshed out in more detail: https://stackoverflow.com/questions/53745570/doing-a-jdbc-query-on-a-h2-view-with-array-agg-returns-a-clob-type-not-an-array)

seancorfield17:12:21

You'll probably have to extend one of the protocols to do the conversion.

ana17:12:25

i see, will try that; thanks!

ana17:12:26

hi sean, just to check: i was going to follow this stack overflow post but is this what you had in mind by extending the protocol? https://stackoverflow.com/questions/19103870/jsonify-a-jdbc4array-in-clojure

seancorfield17:12:55

Something like that, yeah.

seancorfield18:12:23

In next.jdbc, this will be a lot easier. Partly because you'll be able to specify protocol extensions on the fly for specific columns. Which will require Clojure 1.10.

seancorfield18:12:14

(and it will also have built-in datafy/`nav` support)

ana18:12:37

thank you!