Skip to content
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

New deserialization API - yet another bunch of preparations #1088

Conversation

wprzytula
Copy link
Collaborator

@wprzytula wprzytula commented Oct 11, 2024

Ref: #462

In order to make the main deserialization PR at least a bit smaller, I extracted another bunch of preparatory changes.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • [ ] I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • [ ] I have adjusted the documentation in ./docs/source/.
  • [ ] I added appropriate Fixes: annotations to PR description.

This refactor:
1) aids readability;
2) allows sharing the common logic with soon-to-be-added
   deser_col_specs_borrowed.
Copy link

github-actions bot commented Oct 11, 2024

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳
Checked commit: 5cb42fa

@wprzytula wprzytula added this to the 0.15.0 milestone Oct 11, 2024
scylla-cql/src/frame/response/result.rs Outdated Show resolved Hide resolved
Similarly to what has been recently done with `deser_cql_type`,
`deser_col_specs` is made a macro to avoid code duplication between
owned and borrowed variant of that function.

For now, to avoid warnings, borrowed variants of `deser_cql_type` and
`deser_col_specs` are prefixed with an underscore. This will change once
they are actually used.
When parsing rows, type check is a distinct phase in the new
deserialization framework. To support propagation of errors related to
type checking, a corresponding variant is added to RowsParseError.
RowsParseError is going to be a user-facing error type, because it is
going to be returned from new QueryResult API. For convenient conversion
into QueryError, a shortcut From impl is added.
@wprzytula wprzytula force-pushed the new-deserialization-api-yet-another-preparatory-bunch branch from 41b79a4 to 5cb42fa Compare October 11, 2024 11:43
@wprzytula wprzytula merged commit eb14ca8 into scylladb:main Oct 11, 2024
11 checks passed
@wprzytula wprzytula deleted the new-deserialization-api-yet-another-preparatory-bunch branch October 11, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants