Repository navigation
feat: implement connection option getters - #65
Merged
abonander merged 2 commits intoNov 13, 2026
Merged
Conversation
pedro-filardi
force-pushed
the
feat/connection-option-getters
branch
from
July 23, 2026 10:58
798f86d to
2b75b70
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Implements missing Connection::get_option_* readbacks needed by ADBC driver managers to successfully validate and use a ClickHouse connection, aligning connection option behavior with the existing ClickhouseDatabase option handling.
Changes:
- Implemented
ClickhouseConnection::get_option_string()forAutoCommit,CurrentCatalog, andCurrentSchema. - Made
get_option_bytes()delegate toget_option_string(), and updatedget_option_int()/get_option_double()to returnInvalidArguments. - Added integration tests covering the connection option getters and updated the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/it/main.rs | Adds an integration test validating the new connection option getter behaviors and statuses. |
| src/lib.rs | Implements connection option getters (string/bytes/int/double) for well-defined ClickHouse behaviors. |
| CHANGELOG.md | Documents the new option getter support under Unreleased and links the tracking issue. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
koletzilla
reviewed
Jul 29, 2026
abonander
requested changes
Aug 31, 2026
Report AutoCommit as "true" and CurrentCatalog as empty, since driver managers read these back before using a connection. get_option_bytes() defers to get_option_string(), and get_option_int()/get_option_double() report InvalidArguments, matching ClickhouseDatabase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pedro-filardi
force-pushed
the
feat/connection-option-getters
branch
from
October 2, 2026 09:26
b2c4929 to
cdb9105
Compare
AI review gate — auto-approval withheldThe AI review gate is green, but the approver did not approve What to do: ask someone with write access who is not the PR author to approve this pull request. |
abonander
approved these changes
Nov 13, 2026
joe-clickhouse
approved these changes
Nov 13, 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.
Summary
Connection::get_option_string()returnedNotImplementedforAutoCommitandCurrentCatalog. ADBC driver managers read these back before they will use a connection, so erroring on them can leave the driver unusable through one.Rebuilt on top of #72, which already reads
CurrentSchemaback from the configured database, so theSELECT currentDatabase()from the earlier revision is gone.OptionConnection::AutoCommit→"true". ClickHouse has no transactions, so statements always commit as they run.OptionConnection::CurrentCatalog→"". ClickHouse has no catalog level above the database, which maps onto ADBC'sdb_schema. That leaves the catalog empty, not unsupported.get_option_bytes()defers toget_option_string(), andget_option_int()/get_option_double()reportInvalidArguments, mirroringClickhouseDatabase.ReadOnlyandIsolationLevelkeep returningNotImplemented. The error message now matchesset_option().Addresses #8.
Note on scope
This is necessary but not sufficient for a driver manager to attach a ClickHouse database.
get_objects()(#10) is required as well.Checklist
🤖 Generated with Claude Code
Note
Low Risk
Targeted read-only option API behavior with tests; no query or auth paths changed.
Overview
Implements
Connection::get_option_string()forAutoCommit(always"true"because ClickHouse has no transactions) andCurrentCatalog(always""because there is no catalog above the database). That unblocks ADBC driver managers that read these options before using a connection.get_option_bytes()now delegates toget_option_string();get_option_int()andget_option_double()returnInvalidArguments, matchingClickhouseDatabase. Unimplemented options (e.g.ReadOnly,IsolationLevel) use the same error shape asset_option()instead of generic unimplemented stubs.Adds integration test
connection_option_gettersand an Unreleased changelog entry.Reviewed by Cursor Bugbot for commit cdb6a34. Bugbot is set up for automated code reviews on this repo. Configure here.