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

cassandra_int_tests: Refactor CassandraConnection execute methods #943

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

rukai
Copy link
Member

@rukai rukai commented Nov 29, 2022

CassandraConnection implementation changes:

  • improves support for the scylla and cdrs-tokio driver backends, I think the only thing they are missing now is TLS support.
  • greatly reduces duplicated logic across: batch, prepared and regular queries. image 👀

CassandraConnection API changes:

  • _fallible methods return more useful types:
    • On success they return the generic Vec of results instead of some cassandra_cpp specific type.
    • On failure they return the cdrs-tokio errors instead of cassandra_cpp errors because cdrs-tokio errors are nicer to construct and read from
  • _expect_err methods are replaced with _fallible methods, this gives us a more composable API.
  • The execute method is kept instead of just using execute_fallible because it provides a better error message on failure then just unwrap.
  • The execute_batch method is kept instead of just using execute_batch_fallible because it provides better assertions.

@conorbros
Copy link
Member

LGTM. Should probably rename those methods at some point, execute and execute prepared are a bit confusing.

@rukai rukai force-pushed the execute_fallible branch 3 times, most recently from 6ed9179 to 74688f9 Compare December 8, 2022 00:16
@rukai rukai merged commit 4414a49 into shotover:main Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants