feat(rust): add GetInfo/GetObjects/GetStatistics result builders - #5
Open
fornwall wants to merge 1 commit into
Open
feat(rust): add GetInfo/GetObjects/GetStatistics result builders#5fornwall wants to merge 1 commit into
fornwall wants to merge 1 commit into
Conversation
Add public GetInfoBuilder, GetObjectsBuilder, and GetStatisticsBuilder to adbc_core::schemas::builder with typed append_* / finish() -> RecordBatch APIs that own the union type-ids, list offsets, and null handling for the nested get_info / get_objects / get_statistics result shapes. Rewrite the dummy driver to use them, deleting ~440 lines of hand-rolled union/list/struct assembly and the now-unused arrow-buffer dependency. Field definitions are pulled from the schemas::* constants so array and schema types cannot drift apart. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fornwall
force-pushed
the
rust-result-builders
branch
from
July 7, 2026 22:42
442a71d to
f0f8423
Compare
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.
What
Adds public
GetInfoBuilder,GetObjectsBuilder, andGetStatisticsBuildertoadbc_core::schemas::builderwith typedappend_*/finish() -> RecordBatchAPIs that own the union type-ids, list offsets, and null handling for the nestedget_info/get_objects/get_statisticsresult shapes.Previously drivers hand-rolled the nested union/list/struct assembly inline. Go's
driverbaseand the C++ driver framework already absorb exactly this for their drivers.Changes
rust/core/src/schemas/builder.rs:GetInfoBuilder—append_string/append_bool/append_int64/append_int32_bitmask/append_string_list/append_int32_to_int32_list_map(all six union variants).GetObjectsBuilder— hierarchicalappend_catalog→append_db_schema→append_table→append_column/append_constraint, with helper structsColumnSchema,TableConstraint,ConstraintUsage. RespectsObjectDepth, emitting null lists for levels below the requested depth.GetStatisticsBuilder—append_catalog→append_db_schema→append_statistic, with aStatisticValueenum for the value union.schemas::*constants, so array and schema types cannot drift apart.get_info,get_objects,get_statistics), producing byte-identical output. Removed the now-unusedarrow-bufferdependency; added it toadbc_core.Testing
cargo test -p adbc_core -p adbc_dummy— all pass, including the dummy driver's exported-vs-native FFI round-trip equality tests (confirming output is unchanged) and 4 new unit tests + a doctest in the builder module.cargo build --workspace— clean.🤖 Generated with Claude Code