-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support unsigned
versions of integers.
#409
Comments
I don't think that the driver should do any implicit lossy casts (e.g. |
Lossy - definitely not. A runtime bound check should be performed |
Since it just bit me, for varint columns I think serialising a u64 should Just Work. Also, while I am a big fan of strongly typed APIs, this snippet makes me think that strong typing isn't really possible in the current design
On my machine it outputs
which, since the To me it makes the unsigned limitation seem rather arbitrary though :) |
Why would we want to support unsigned integers directly in the driver?
So, I think we should implement Specifics
|
I think that this idea may backfire on us later. Lack of unsigned types in Scylla / C* is of course an issue for some application developers because it increases complexity (as the developer now needs to validate data and deal with errors). New deserialization framework will probably allow to downcast error to specific implementation and check what exactly went wrong - but doing this will be much more difficult that creating 2 structures (first with signed types, to interact with DB, second with unsigned types, to use in rest of the application) and handling conversion errors. for those reasons I think it's better to make users aware of this complexity and deal with it explicitly - it will result in more robust, less error-prone applications. |
Instead of implementing There are 4 different approaches:
I'm using |
Unsigned versions can be automatically mapped to the
signed
versions that database uses.The text was updated successfully, but these errors were encountered: