vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

Allow set/get json column as Buffer (utf-8 encoded string)

Open longdt opened this issue 5 years ago • 4 comments

Sometime I want to map Json column <-> POJO object. So it's great if I can set json column as Buffer (utf-8 string bytes), and get json column as Buffer when retrieve. This allow me use dsl-json (https://github.com/ngs-doo/dsl-json A high performance json mapping) to convert Pojo object <-> json bytes. I know we can use JsonObject.map() but it's slow due jackson is pretty slow and we need created temporary json object. I think directly mapping from bytes to pojo is more performance

longdt avatar Dec 21 '20 03:12 longdt

I'm not sure this is possible but we will see what we can do

vietj avatar Jan 04 '21 08:01 vietj

It would be good if we make the data type codec registrable so that we can not only provide APIs for custom codecs but also make it possible to dynamically plug in a codec for Postgres custom data type(see https://github.com/eclipse-vertx/vertx-sql-client/issues/343).

BillyYccc avatar Jan 05 '21 00:01 BillyYccc

There is also a similar request in https://github.com/eclipse-vertx/vertx-sql-client/issues/476.

BillyYccc avatar Jan 05 '21 01:01 BillyYccc

@longdt can you cast in the Postgres query the JSON to a String or Buffer and then get the encoded JSON from here ?

vietj avatar Jun 03 '21 09:06 vietj