I have an enum in postgresql defined like so:
create type color as enum ('yellow', 'purple', 'white', 'black');
And I can get to the Jdbc4Array like so:
(def colors
((first (sql/with-connection db/db
(sql/with-query-results res
["select enum_range(null::color)"]
(doall res)))) :enum_range))
This shows an object like this:
#<Jdbc4Array {yellow,purple,white,black}>
But trying the usual things throws an exception:
(.getArray colors) => stream closed
So I figure I need to access the array before the connection is closed:
(def colors
((sql/with-connection db/db
(sql/with-query-results res
["select enum_range(null::color)"]
(.getArray ((first (doall res)) :enum_range))))))
But in this case I get this exception:
Method org.postgresql.jdbc4.Jdbc4Array.getArrayImpl(long,int,Map)
is not yet implemented.
Sinister. What can I do here?