Re: Jsonify a Jdbc4Array in Clojure

2013-10-02 Thread John D. Hume
mplement the JSONWriter protocol for the >>>>>>> Jdbc4Array class, and possibly for the datatypes that are in the >>>>>>> array. This for example makes the json library aware of >>>>>>> java.util.Date classes. >>>>>&g

Re: Jsonify a Jdbc4Array in Clojure

2013-10-02 Thread Christian Jauvin
>>>>> >>>>>> (extend-type java.util.Date >>>>>> JSONWriter >>>>>> (-write [date out] >>>>>> (-write (str date) out))) >>>>>> >>>>>> Something like this (not tested): &

Re: Jsonify a Jdbc4Array in Clojure

2013-10-02 Thread Christian Jauvin
t;>> (-write [date out] >>>>> (-write (str date) out))) >>>>> >>>>> Something like this (not tested): >>>>> >>>>> (extend-type org.postgresql.jdbc4.**Jdbc4Arra**y >>>>> JSONWriter >>>

Re: Jsonify a Jdbc4Array in Clojure

2013-10-01 Thread John D. Hume
y)) out))) >>>> >>>> Roman >>>> >>>> >>>> On Tuesday, October 1, 2013 3:57:02 PM UTC+2, Christian Jauvin wrote: >>>>> >>>>> Hi, >>>>> >>>>> I asked this question on Stack Overflow

Re: Jsonify a Jdbc4Array in Clojure

2013-10-01 Thread Christian Jauvin
I want to jsonify the results of a query performed against a Postgres >>>> table containing a column of type text[], but the problem is that >>>> clojure.data.json.write-str doesn't seem to know how to handle PG >>>> arrays: >>>> >>>> *E

Re: Jsonify a Jdbc4Array in Clojure

2013-10-01 Thread Philippe Guillebert
a Postgres >>> table containing a column of type text[], but the problem is that >>> clojure.data.json.write-str doesn't seem to know how to handle PG >>> arrays: >>> >>> *Exception Don't know how to write JSON of class >>> org.postg

Re: Jsonify a Jdbc4Array in Clojure

2013-10-01 Thread Christian Jauvin
of class >> org.postgresql.jdbc4.Jdbc4Array clojure.data.json/write-generic* >> >> Do I have to supply a custom handler, or is there a simpler way? >> >> >> >> http://stackoverflow.com/questions/19103870/jsonify-a-jdbc4array-in-clojure >> >> I'm

Re: Jsonify a Jdbc4Array in Clojure

2013-10-01 Thread r0man
te JSON of class > org.postgresql.jdbc4.Jdbc4Array clojure.data.json/write-generic* > > Do I have to supply a custom handler, or is there a simpler way? > > > http://stackoverflow.com/questions/19103870/jsonify-a-jdbc4array-in-clojure > > I'm asking it here in the

Jsonify a Jdbc4Array in Clojure

2013-10-01 Thread Christian Jauvin
now how to write JSON of class org.postgresql.jdbc4.Jdbc4Array clojure.data.json/write-generic* Do I have to supply a custom handler, or is there a simpler way? http://stackoverflow.com/questions/19103870/jsonify-a-jdbc4array-in-clojure I'm asking it here in the hope of getting (m