vertx-sql-client
vertx-sql-client copied to clipboard
Is there any way to disable json decoding on json/jsonb fields?
Hi
Is there any way to disable json decoding on queries that involves json/jsonb fields? I'm working on the clojure (https://github.com/vertx-clojure) adaptation of the pgclient and I found that when I make the query (with jsonb fields) and the resulting rows has the jsonb fields already decoded to JsonObject.
The problem is that converting that JsonObject (or JsonArrray) to something usable in clojure has the overhead of unnecessary data copying (or json encode/decode round-trip). Would be awesome to be able disable builtin json decoding (and leave is as text...); this will allow decode it directly to clojure data structures without additional copy and/or encode/decode process.
Thanks.
It looks like quite a common use case here, but currently our type mappings are intrinsically built.
I wonder if we could provide a mechanism to register/unregister type codecs so that users could customize the data type mapping, I think it would be very useful in Postgres since PG has a rich type support. Such pluggable ability would also address the issues described in https://github.com/eclipse-vertx/vertx-sql-client/issues/343.