Skip to content

test(c/driver_manager): fully test driver/uri/profile combinations#4092

Merged
lidavidm merged 1 commit intoapache:mainfrom
lidavidm:gh-4085
Mar 18, 2026
Merged

test(c/driver_manager): fully test driver/uri/profile combinations#4092
lidavidm merged 1 commit intoapache:mainfrom
lidavidm:gh-4085

Conversation

@lidavidm
Copy link
Member

Closes #4085.

@lidavidm
Copy link
Member Author

This is stacked, review only the last commit.

@lidavidm lidavidm marked this pull request as ready for review March 16, 2026 06:29
@lidavidm lidavidm requested a review from zeroshade as a code owner March 16, 2026 06:29
@lidavidm lidavidm requested a review from amoeba March 16, 2026 06:29
@lidavidm
Copy link
Member Author

@zeroshade if you could review this and #4088, then I can manage rebasing/merging and avoid another round trip :)

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;
}
Copy link
Member

Choose a reason for hiding this comment

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

I hate that we have to do this, but it's a clever way to handle it 😄

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;
}
Copy link
Member

Choose a reason for hiding this comment

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

should this and the other various error scenarios be documented in the rst as explicitly error scenarios?

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'm going to go back at the end and reconcile the docs (and Rust)

@lidavidm lidavidm merged commit 75ca3d6 into apache:main Mar 18, 2026
91 checks passed
@lidavidm lidavidm deleted the gh-4085 branch March 18, 2026 01:37
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.

c/driver_manager: investigate/test overriding driver (and other params) in profile

2 participants