Rust client core for Databricks SQL. Exposes a Databricks-native v0
async API (Session → Statement → ExecutedStatement /
ExecutedAsyncStatement → ResultStream, plus a flat Metadata
surface) intended for direct Rust use, PyO3 / napi-rs wrappers, and a
custom C ABI (skeleton today) for ODBC / Go consumers.
The standalone adbc/ workspace implements ADBC 1.1 directly against that native
Rust API. Its optional standard ADBC C ABI is an outer compatibility surface;
the ADBC-to-kernel boundary remains native Rust.
The repo was seeded from adbc-drivers/databricks (Rust subtree); the
v0 surface lives at the crate root and the legacy ADBC layer has been
removed.
cargo build
cargo test # all tests, including doc tests
cargo +stable fmt --all
cargo clippy --all-targets -- -D warnings
make check # fmt + clippy + testscargo test (no filters) is what CI runs. --lib --tests skips doc tests.
cargo +stable fmt --all
cargo clippy --all-targets -- -D warnings
cargo test- Title follows conventional commits:
type(scope): description. No JIRA prefixes — CI rejects them. - Commits must be DCO-signed (
git commit -s). Enforced by.github/workflows/dco-check.yml.
v0 surface (see docs/spec-v0.md):
Session -> Statement -> ExecutedStatement -> ResultStream
-> ExecutedAsyncStatement -> ResultStream
Session -> Metadata (flat per-method catalog API)
| Module | Purpose |
|---|---|
session/ |
Session + SessionBuilder (stateful authenticated handle) |
statement/ |
Statement (mutable), ExecutedStatement, ExecutedAsyncStatement, StatementSpec, TypedValue |
result_stream/ |
ResultStream + borrowed Row<'a> cursor over Arrow batches |
metadata_v0/ |
Flat per-method Metadata surface (catalogs, schemas, tables, …) |
config/ |
Typed SessionConfig / AuthConfig / ConnectionConfig / etc. |
kernel_error/ |
Error + ErrorCode (kernel-native error type) |
auth/ |
Authentication (PAT, OAuth M2M, OAuth U2M) |
client/ |
HTTP transport to Databricks (SEA, retry, transport trait) |
reader/ |
Result fetching (CloudFetch, inline Arrow) |
result/ |
Result set abstraction over Arrow RecordBatches |
metadata/ |
Shared SQL builders + schemas for Metadata |
ffi/ |
Custom C ABI for ODBC / Go (skeleton) |
telemetry/ |
Metrics collection |
adbc/ |
Native Rust ADBC driver and optional driver-manager C ABI |
Internal code returns crate::Result<T>, built via the categorised
constructors on Error (Error::invalid_argument(), Error::io(),
Error::not_implemented(), Error::invalid_state(), …) chained with
.message(...) / .with_source(...) / .sqlstate(...).
CI runs cargo-deny check (.github/workflows/license-check.yml)
and fails on unapproved licenses or RustSec advisories. New
permissive licenses must be added to [licenses].allow in
deny.toml with PR-description justification. about.toml is
preserved separately for generating attribution pages on demand;
the CI gate lives on deny.toml.
Per go/hardened-gha, the protected runners block direct access to public package registries (crates.io, PyPI, npm, etc.). Third-party dependency fetches route through Databricks-filtered proxies.
How this shows up in the repo:
- GitHub Actions steps are SHA-pinned, with the version tag in
a trailing comment (e.g.
uses: actions/checkout@34e1148... # v4). - Credential-free public dependencies use
.github/actions/setup-public-package-proxies. This credential-free composite configures Cargo and Python to use the filtered public proxies and does not requireid-token: write. Cargo-only CI uses it for trusted pushes, same-repository PRs, and fork PRs when no private packages are needed. - Authenticated or private dependencies use
.github/actions/setup-jfrog. This composite exchanges GitHub OIDC for access todb-cargo-remoteanddb-pypi, so callers must grantid-token: writeand must not expose that job to fork-controlled code. Cargo.lockcarries per-crate SHA256 checksums (source = "registry+..."+checksum = "..."), which is Cargo's native pinning mechanism. The pyo3 sub-crate uses uv for Python env management.- Python dep pinning follows the externally-published-library
rule from go/pinning-python-deps:
major-version upper bounds in
pyo3/pyproject.toml(pyarrow>=14,<19), no exact pins, no transitive constraints, no committed lockfile. Exact pins would impede downstreampip install databricks-sql-kernelfor end-users with their own pyarrow consumers. Trusted jobs usedb-pypi, whose 7-day age filter is their baseline supply-chain protection. Fork jobs use the credential-free public proxy; its filtering policy is separate and does not promise the same 7-day delay.uv syncre-resolves each CI run within the major-version bounds. - Composite actions: both proxy setup actions write Cargo and uv/pip
configuration; only
setup-jfrogperforms an OIDC token exchange.
Connection variables for E2E tests can be set via .cargo/config.toml
(gitignored — do not commit) under [env]:
[env]
DATABRICKS_HOST = "https://your-workspace.databricks.com"
DATABRICKS_HTTP_PATH = "/sql/1.0/warehouses/abc123"
DATABRICKS_TOKEN = "your-pat-token"
RUST_LOG = "databricks_sql_kernel=debug"E2E tests requiring a live Databricks connection are marked #[ignore] and run only when those variables are set.
- Databricks SQL Statement Execution API
- Apache Arrow Rust
docs/spec-v0.md— v0 Kernel API specdocs/migration-plan.md— staged migration plan from ADBC to v0