Skip to content

feat(rust): initial Rust ADBC driver project setup#191

Merged
vikrantpuppala merged 4 commits intoadbc-drivers:mainfrom
vikrantpuppala:rust-setup
Jan 28, 2026
Merged

feat(rust): initial Rust ADBC driver project setup#191
vikrantpuppala merged 4 commits intoadbc-drivers:mainfrom
vikrantpuppala:rust-setup

Conversation

@vikrantpuppala
Copy link
Collaborator

Summary

  • Add scaffolding for the Rust ADBC driver with core ADBC types (Driver, Database, Connection, Statement, ResultSet)
  • Add authentication module with PAT (working) and OAuth (stub)
  • Add HTTP client, CloudFetch reader, telemetry collector, and error types
  • Add comprehensive documentation (README.md, CLAUDE.md for LLM-assisted development)

Project Structure

rust/
├── Cargo.toml                  # Package configuration
├── Makefile                    # Build automation
├── README.md                   # Project documentation
├── CLAUDE.md                   # LLM development guide
├── src/
│   ├── lib.rs                  # Library root
│   ├── error.rs                # Error types
│   ├── driver.rs               # ADBC Driver
│   ├── database.rs             # Database configuration
│   ├── connection.rs           # Connection implementation
│   ├── statement.rs            # Statement execution
│   ├── auth/                   # Authentication (PAT, OAuth)
│   ├── client/                 # HTTP client
│   ├── reader/                 # CloudFetch reader
│   ├── result/                 # ResultSet with Arrow RecordBatch
│   └── telemetry/              # Metrics collection
└── tests/
    └── integration.rs          # Integration tests

Test plan

  • cargo build passes
  • cargo test passes (21 tests)
  • cargo fmt -- --check passes
  • cargo clippy -- -D warnings passes

🤖 Generated with Claude Code

Add scaffolding for the Rust ADBC driver with:
- Core ADBC types: Driver, Database, Connection, Statement, ResultSet
- Authentication module with PAT (working) and OAuth (stub)
- HTTP client module with configuration
- CloudFetch reader for high-performance result downloads
- Telemetry collector for metrics
- Error types using thiserror
- Unit tests (19) and integration tests (2)
- Makefile for build automation
- README.md with project structure documentation
- CLAUDE.md for LLM-assisted development

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

None of the actual ADBC traits seem to be implemented?

@lidavidm
Copy link
Contributor

And for consistency it would be best to use https://github.com/adbc-drivers/driverbase-rs (in particular the error types/formatting there)

@vikrantpuppala
Copy link
Collaborator Author

@lidavidm this is an early PR which is only setting up the rust project, we will add the actual functionality in follow up PRs

@lidavidm
Copy link
Contributor

Sure. I would still like to make sure these points are addressed, whether here or in follow up PRs.

Additionally the pre-commit check is not passing (the title check can be ignored, though) and we will need to enable the Rust CI workflows. And ideally we should add rust linting/formatting to the pre-commit check.

@lidavidm
Copy link
Contributor

In particular: these all have license headers implying this is sourced from Apache Software Foundation repos. If that is the case, NOTICE.txt should be updated (and I would appreciate knowing which repo in particular)

Copy link
Contributor

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

At a minimum let's fix the license headers

- Implement adbc_core::Driver, Database, Connection, Statement traits
- Use driverbase-rs for error handling (ErrorHelper trait)
- Fix license headers to use "ADBC Drivers Contributors" copyright
- Align arrow dependencies to v57 to match driverbase
- All trait methods return NotImplemented stubs for now

Addresses PR review comments:
- ADBC traits are now properly implemented
- Using driverbase-rs for consistency
- License headers corrected (not ASF sourced)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment on lines +33 to +38
```bash
~/.cargo/bin/cargo build # Build the library
~/.cargo/bin/cargo test # Run all tests
~/.cargo/bin/cargo fmt # Format code
~/.cargo/bin/cargo clippy -- -D warnings # Lint with warnings as errors
```
Copy link
Contributor

Choose a reason for hiding this comment

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

(Why are we specifying the full path to cargo? Presumably it should be on PATH, and not something potentially platform-specific?)

Comment on lines +123 to +131
### File Headers

All files must have Apache 2.0 license headers:

```rust
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// ...
```
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong, let's not mislead the LLM.

Comment on lines +186 to +194
### 4. Implementing Statement Execution

Reference: `../csharp/src/StatementExecution/`

Key steps:
1. POST to `/api/2.0/sql/statements` endpoint
2. Poll for completion or use async mode
3. Parse response for result links (CloudFetch) or inline data
4. Return ResultSet
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Databricks provide documentation for this apparent REST API?

}
}
OptionDatabase::Other(ref s) => match s.as_str() {
"adbc.databricks.http_path" => {
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no need for the "adbc." prefix for option names. The upstream drivers do this because of some unfortunate copy-paste habits, but there's no need here.

Comment on lines +92 to +99
### Arrow Integration

Results use Apache Arrow types:

```rust
use arrow::datatypes::SchemaRef;
use arrow::record_batch::RecordBatch;
```
Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't the right import paths

vikrantpuppala and others added 2 commits January 27, 2026 16:23
- Remove full cargo path from CLAUDE.md (use PATH instead)
- Remove C# specific references from CLAUDE.md module table
- Fix Arrow import paths in CLAUDE.md examples
- Fix license header example in CLAUDE.md
- Replace API endpoint details with link to official docs
- Remove "adbc." prefix from option names in database.rs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused empty_reader() function and std::sync::Arc import
- Add TODO comments explaining when dead code will be used (access_token, client_secret)
- Remove public client_secret() getter to prevent accidental secret exposure
- Pin driverbase git dependency to specific commit hash for reproducibility
- Update README dependencies to reflect actual crates used
- Fix error messages: use "option not set" instead of "unknown option" for unset options
- Disable telemetry by default (opt-in) and document what data is collected
- Rename test for clarity: test_cloudfetch_reader_empty_links_returns_none
- Update CLAUDE.md with correct driverbase error handling patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vikrantpuppala vikrantpuppala added this pull request to the merge queue Jan 28, 2026
Merged via the queue into adbc-drivers:main with commit 062b6e4 Jan 28, 2026
1 of 2 checks passed
@vikrantpuppala vikrantpuppala deleted the rust-setup branch January 28, 2026 08:41
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.

3 participants