A way around io.vertx.sqlclient.Row returning boolean columns as Byte.

57 views
Skip to first unread message

Olofu Mark

unread,
Sep 20, 2023, 6:51:39 PM9/20/23
to vert.x

We moving to the reactive MySQL Client.

the legacy JDBC Client was returning boolean columns as boolean which was pretty what we want. 

io.vertx.sqlclient.Row is returning boolean columns in its raw form(i understand that mysql stores a boolean as tinyint) which breaks all our front end applications.

is there a way around it? i.e to retrieve boolean columns as java boolean?

Thanks.

Olofu Mark

unread,
Sep 21, 2023, 4:45:08 AM9/21/23
to vert.x
thought this would work but it didn't.

connectOptions.addProperty("tinyInt1isBit", "false");

Olofu Mark

unread,
Sep 21, 2023, 5:16:08 AM9/21/23
to vert.x
these also didn't work.
        connectOptions.addProperty("tinyInt1isBit", "true");
        connectOptions.addProperty("transformedBitIsBoolean", "true");

Thomas SEGISMONT

unread,
Sep 21, 2023, 9:40:07 AM9/21/23
to ve...@googlegroups.com

It is stored in the row or tuple as a java.lang.Byte but you can get the boolean value with Row.getBoolean

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/0ba87e40-0e1c-4916-8c30-2557920cc6fbn%40googlegroups.com.

Olofu Mark

unread,
Sep 22, 2023, 7:34:33 PM9/22/23
to vert.x
We stream Row#toJson() to clients without modifications.
Trying to avoid the overhead of first reading individual columns as boolean and then manually reinserting into the Json.

Thanks anyway.



Everything else seems great.

Please how does one observe what's going on in the connection pool, see connections state?

Thomas SEGISMONT

unread,
Sep 25, 2023, 3:50:36 AM9/25/23
to ve...@googlegroups.com
Observability of the pool is provided with Vert.x Metrics (e.g. https://vertx.io/docs/vertx-micrometer-metrics/java/) and Vert.x Tracing (https://vertx.io/docs/vertx-opentelemetry/java/)

Olofu Mark

unread,
Sep 29, 2023, 9:24:13 PM9/29/23
to vert.x
Thanks Thomas,

Please would like to understand a bit more:

Given that Row.getBoolean is already possible, wouldn't it be more useful to have rows return booleans out of the box based on our own configuration?
is there a deeper reason why this is currently unavailable?
i.e with the understanding that it requires less code and makes things a lot easier instead of calling getBoolean repeatedly to achieve what i earlier described.
(for despite being the underlying storage type, Byte isn't very useful on its own.)

Thomas SEGISMONT

unread,
Oct 3, 2023, 4:12:58 AM10/3/23
to ve...@googlegroups.com
Feel free to file a request for enhancement to the vertx-sql-client, then we'll talk about it with the maintainer.
Reply all
Reply to author
Forward
0 new messages