nea/vertx-mod-cassandra-persistor

UUIDs values in prepared statements

Closed this issue · 4 comments

Hi nea,

Firstly, thanks for the work already done.

I'm moving to prepared statements, and trying to find a way to add UUIDs (w/o quotes) into the values array. Do you have any ideas? the JsonArray doesn't like UUID objects (Note that the examples in the readme show that this is feasible).

-blackstrype

nea commented

Hi there

Oh damn, sorry about that. Too much copying of text from my side. Right now, UUIDs only work directly in a raw statement. In prepared statement they have to be added as Strings and are manually parsed by me then (I will change the README accordingly).

I also noticed this issue and have fiddled around with it a little bit without any big success, why I made my life easier and ignored it :)

It is absolutely a valid point, just at the moment it has to be a String or raw. But as you bring it up I will definitely have a look at it again.

Sorry

Okay, no hurry on finding a fix. I just wanted to make sure I wasn't missing something obvious.

I thought about having a look myself, but probably the quickest way to handle it for now, is to simply check that it's a valid UUID and put it directly in the statement string (I'm behind a proxy now and recovering the maven dependencies for the cassandra-persistor is proving to be an embarassing challenge for me :p).

Maybe later there's a possibility to extend the JsonArray class with an addUUID function... but I still haven't understood why UUID's aren't supported by the vertx event bus (are they simply not in the list of possible primatives/objects?).

Thanks again for the help.

Good news: the updated datastax drivers seem to fix the conundrum of uuid's as strings :-)

nea commented

Ah, awesome to know. Thanks a lot for the info.