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

refactor(r): Improve testing for ADBC 1.1 features in R bindings #1214

Merged
merged 43 commits into from
Oct 26, 2023

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Oct 19, 2023

This PR implements option setting/getting in the "void" driver and implements tests for the full grid of set/get by string/bytes/integer/double by database/connection/statement. The error detail information was also not implemented in the dummy driver and so couldn't be tested (so there is an implementation of that here).

Implementing a driver that actually did this was sufficient work that I did some rather heavy abstraction to make it easier to write. That abstraction is not unlike a "driver framework" except it is (1) not complete, since the void driver only needs options methods and (2) doesn't provide any result helpers (building streams, etc.). It might be worth porting the driver base to be more general but for now I'd like to keep it constrained to what I need to test in R.

Closes #1126.

@paleolimbot paleolimbot marked this pull request as ready for review October 23, 2023 15:04
Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

went through the C/C++ code, left some comments / questions / nitpicks. in general it looks good to me though


explicit Error(const char* message) : Error(std::string(message)) {}

Error(const std::string& message,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also explicit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one doesn't need it because there's two arguments to the constructor?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point, we aren't using default args for the second argument so you're right.

r/adbcdrivermanager/src/driver_base.h Outdated Show resolved Hide resolved
r/adbcdrivermanager/src/driver_base.h Outdated Show resolved Hide resolved
r/adbcdrivermanager/src/driver_base.h Outdated Show resolved Hide resolved
@paleolimbot paleolimbot merged commit ef72e6f into apache:main Oct 26, 2023
48 checks passed
@paleolimbot paleolimbot deleted the r-options-testing branch November 9, 2023 13:21
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.

r/adbcdrivermanager: Improve options handling
2 participants