feat(rust): rust adbc snowflake driver - #104
Draft
zeroshade wants to merge 105 commits into
Draft
Conversation
Implement From<ApiError> trait to convert sf_core errors to adbc_core errors, with exhaustive mapping of all 16 ApiError variants to appropriate Status codes. Also add not_implemented() helper for NotImplemented errors.
- Add src/driver.rs: Inner struct (tokio Runtime + DatabaseDriverV1) and Driver wrapping Arc<Inner>, implementing adbc_core::Driver trait - Add stub src/database.rs, src/connection.rs, src/statement.rs that compile with todo!() bodies for later tasks - Update src/lib.rs to expose Driver, Database, Connection, Statement - Fix arrow-array/schema version constraints to match adbc_core (57.x) to avoid duplicate crate instance trait bound failures - Fix error.rs test to use public sf_core APIs instead of pub(crate) snafu builder internals (InvalidArgumentSnafu) - Add .cargo/config.toml with prefer-dynamic=no to work around sf_core dylib linker issues when building test binaries 2 driver tests pass: driver_default_creates_successfully, new_database_succeeds_with_no_options
Replaces the database.rs stub with full Optionable + adbc_core::Database implementation: ADBC key → sf_core param mapping, URI parsing, and new_connection_with_opts that propagates settings and calls connection_init. Adds set_autocommit/execute_simple stubs to connection.rs for compilation. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Implements full connection.rs for Task 5: lifecycle (Drop), set_autocommit/execute_simple helpers, Optionable (AutoCommit, CurrentCatalog, CurrentSchema), and adbc_core::Connection methods (new_statement, get_info, get_table_types, get_table_schema, commit, rollback). Adds snowflake_type_to_arrow mapping for DESC TABLE results. Also adds arrow-buffer v57 as a direct dep to resolve version conflict with arrow-array v57 transitive dep. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replace the incorrect List<Utf8> arm-5 placeholder in get_info() with a proper empty MapArray (Map<Int32, List<Int32>>) so that RecordBatch::try_new schema validation succeeds. Also fix the UnionFields arm-5 declaration from Field::new_list to Field::new_map to match the adbc_core GET_INFO_SCHEMA.
Ignore local editor and agent state, reject unsupported multi-row query bindings while retaining batched DML, and update the driver for the current sf_core result-set API.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Rust Snowflake ADBC driver built on universal-driver, with packaging, CI, validation, and vendored development tooling.
Changes:
- Implements Rust driver APIs, bindings, ingestion, metadata, and Arrow conversion.
- Adds Snowflake validation fixtures and documentation.
- Adds build/release infrastructure and vendored ADBC tooling.
Reviewed changes
Copilot reviewed 105 out of 145 changed files in this pull request and generated 10 comments.
Show a summary per file
| File(s) | Description |
|---|---|
rust/src/{lib,error,driver,database,connection,statement,ingest,get_objects}.rs |
Core Rust driver implementation. |
rust/{Cargo.toml,build.rs,about.toml,manifest.toml,license.tpl,pixi.toml} |
Build, dependency, licensing, and packaging configuration. |
rust/{.gitignore,.gitattributes,.cargo/config.toml} |
Rust workspace configuration. |
rust/docs/snowflake.md |
Driver usage documentation. |
rust/ci/test_package.py |
Packaged-driver smoke test. |
rust/ci/scripts/pre-build.sh |
Platform build preparation. |
rust/validation/README.md |
Validation setup instructions. |
rust/validation/README_sf_core_limitations.md |
Documents backend and sf_core limitations. |
rust/validation/pytest.ini |
Validation test configuration. |
rust/validation/tests/{__init__,conftest,snowflake,generate_documentation,test_connection,test_ingest,test_query,test_statement}.py |
Snowflake validation harness. |
rust/validation/tests/.gitignore |
Validation test ignore rules. |
rust/validation/queries/type/select/* |
Snowflake select-type fixtures and expected schemas. |
rust/validation/queries/type/literal/* |
Snowflake literal-type fixtures. |
rust/validation/queries/type/bind/* |
Parameter-binding fixtures across supported types. |
rust/validation/queries/ingest/* |
Bulk-ingestion fixtures and type overrides. |
vendor/adbc-drivers-dev/{README.md,LICENSE.txt,NOTICE.txt,MANIFEST.in,pyproject.toml} |
Vendored package metadata and attribution. |
vendor/adbc-drivers-dev/tests/test_detect_version.py |
Vendored tooling regression tests. |
vendor/adbc-drivers-dev/adbc_drivers_dev/{__init__,changelog,copyright,generate,make,package,release,title_check,workflow}.py |
Vendored workflow, packaging, and release utilities. |
vendor/adbc-drivers-dev/adbc_drivers_dev/rat/{__init__,__main__,cli}.py |
Vendored license-audit tooling. |
vendor/adbc-drivers-dev/adbc_drivers_dev/templates/* |
Generated workflow and project templates. |
vendor/adbc-drivers-dev/adbc_drivers_dev/compose.yaml |
Manylinux Compose services. |
vendor/adbc-drivers-dev/adbc_drivers_dev/compose/manylinux/* |
Go manylinux image support. |
vendor/adbc-drivers-dev/adbc_drivers_dev/compose/manylinux-rust/* |
Rust manylinux image support. |
vendor/adbc-drivers-dev/adbc_drivers_dev/compose/manylinux-cpp/* |
C++ manylinux image support. |
vendor/adbc-drivers-dev/adbc_drivers_dev/.env |
Toolchain version defaults. |
go/{pixi.toml,pixi.lock} |
Switches Go tooling to the vendored package. |
.github/workflows/{generate.toml,go_test.yaml,go_release.yaml,dev_pr.yaml} |
Workflow generation and validation coordination. |
.rat-excludes, .rat-apache |
License-check configuration. |
.pre-commit-config.yaml |
Excludes templated YAML from direct validation. |
.gitignore |
Adds local editor and agent-state ignores. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ake-driver # Conflicts: # .github/workflows/go_release.yaml # .github/workflows/go_test.yaml # go/pixi.lock
The merge of origin/main brought in workflows that drop DRIVER=snowflake and IMPL_LANG=go, relying on the newer upstream adbc-drivers-dev reading go/adbc-make.toml. This branch pins the vendored adbc-drivers-dev, which predates that support and still requires DRIVER on the command line, so "Build Library" failed with "Must specify DRIVER=driver". Restore the explicit args on the Go adbc-make invocations and the pixi make task, matching what rust_test.yaml already does.
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.
Adds a rust implementation using
github.com/snowflakedb/universal-driveras the base