test(c/driver_manager): fully test driver/uri/profile combinations#4092
Merged
lidavidm merged 1 commit intoapache:mainfrom Mar 18, 2026
Merged
test(c/driver_manager): fully test driver/uri/profile combinations#4092lidavidm merged 1 commit intoapache:mainfrom
lidavidm merged 1 commit intoapache:mainfrom
Conversation
Member
Author
|
This is stacked, review only the last commit. |
Member
Author
|
@zeroshade if you could review this and #4088, then I can manage rebasing/merging and avoid another round trip :) |
zeroshade
reviewed
Mar 18, 2026
Comment on lines
+448
to
+459
| const bool have_profile = db->options.find("profile") != db->options.end(); | ||
| const bool have_profile_driver = parsed_driver && parsed_driver->profile.has_value(); | ||
| const bool have_profile_uri = parsed_uri && parsed_uri->profile.has_value(); | ||
|
|
||
| if (static_cast<int>(have_profile) + static_cast<int>(have_profile_uri) + | ||
| static_cast<int>(have_profile_driver) > | ||
| 1) { | ||
| SetError(error, | ||
| "Multiple profiles specified; only one of `profile` option, `profile://` " | ||
| "URI, or `profile://` driver is allowed"); | ||
| return ADBC_STATUS_INVALID_ARGUMENT; | ||
| } |
Member
There was a problem hiding this comment.
I hate that we have to do this, but it's a clever way to handle it 😄
zeroshade
reviewed
Mar 18, 2026
Comment on lines
+489
to
+493
| // Don't allow recursive profiles (that is the only way we can reach here) | ||
| if (parsed.profile.has_value()) { | ||
| SetError(error, "Profile cannot specify a profile:// URI"); | ||
| return ADBC_STATUS_INVALID_ARGUMENT; | ||
| } |
Member
There was a problem hiding this comment.
should this and the other various error scenarios be documented in the rst as explicitly error scenarios?
Member
Author
There was a problem hiding this comment.
I'm going to go back at the end and reconcile the docs (and Rust)
zeroshade
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4085.