I have a question on using next.jdbc with the clickhouse jdbc driver.
I have a column in a table with type enum, e.g. mycol Enum8('A' = 1, 'B' = 2)
When I make a query including that column it shows up in the results as a stringified object, e.g. {:mycol "com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$EnumValue@a983d76"}. I want it to always have the result returned as the string value ("A"/"B" for this example)
In my query I can do select toString(mycol) as mycol ... to get it to show as I want it.
I've also determined that I need to call (.getString rs ix) on the ResultSet to get what i want:
{:builder-fn
(rs/as-maps-adapter rs/as-maps
(fn [rs rsmeta idx]
(println (.getColumnType rsmeta idx)) ;; 12
(println (.getType rs)) ;;1003
(.getObject rs idx)))}
However when I try
(extend-protocol rs/ReadableColumn
com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$EnumValue
(read-column-by-index [^com.clickhouse.client.api.data_formats.internal.BinaryStreamReader$EnumValue val
rsmeta idx]
(.getString val idx)))
It doesn't seem like this ever gets called.
Any tips for how I can accomplish always stringifying enum columns like this?