-
Notifications
You must be signed in to change notification settings - Fork 12
ser: use rust-driver's builtin serialization for simple types #152
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
Conversation
Previously, we would reimplement a serialization logic. It was a copy from rust driver, with the typechecks excluded. In this commit, we get rid of the repeated code. To skip the typechecks (or rather, to make the typechecks always pass), we simply provide a valid ColumnType to SerializeValue::serialize(). This is a kind of hack, but thanks to that we don't have to reimplement serialization logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it possible to remove CassCqlValue entirely?
I think it is possible. The main obstacle are udts, collections and tuples. We would need to construct a valid |
Ok, let's keep the approach from this PR |
Actually, I think we could simply have a wrapper over |
Give me a second, I'll investigate it and update this PR in case it's possible. |
Nvm, I don't think there is much sense to introduce a wrapper over CqlValue, since we would need to match variants that can never be created via cpp-rust-driver API (e.g. there is no way to create a I think that we can merge it as is. |
Previously, we would reimplement a serialization logic. It was a copy from rust driver, with the typechecks excluded.
In this PR, we get rid of the repeated code. To skip the typechecks (or rather, to make the typechecks always pass), we simply provide a valid ColumnType to SerializeValue::serialize().
This is a kind of hack, but thanks to that we don't have to reimplement serialization logic.
Pre-review checklist
[ ] I have enabled appropriate tests in.github/workflows/build.yml
ingtest_filter
.[ ] I have enabled appropriate tests in.github/workflows/cassandra.yml
ingtest_filter
.