8 releases (breaking)
| new 0.21.0 | Nov 7, 2025 |
|---|---|
| 0.20.0 | Sep 12, 2025 |
| 0.19.0 | Jul 7, 2025 |
| 0.18.0 | May 6, 2025 |
| 0.14.0 | Sep 5, 2024 |
#786 in Database interfaces
1,798 downloads per month
Used in 5 crates
74KB
935 lines
Arrow Database Connectivity for Rust
This is a Rust implementation of Arrow Database Connectivity (ADBC).
It currently provides:
- An abstract Rust API to be implemented by vendor-specific drivers.
- A driver manager which implements this same API, but dynamically loads drivers internally and forwards calls appropriately using the C API.
- A driver exporter that takes an implementation of the abstract API and turns it into an object file that implements the C API.
- A dummy driver implementation for testing and documentation purposes.
Development
To run the integration tests you must:
- Install a recent version of protobuf and have its
bin(protoc) in path. - Install SQLite and have its dynamic library in path.
- Build the official ADBC SQLite driver and ADBC Snowflake driver by following the documentation.
- Add
-DADBC_DRIVER_SNOWFLAKE=ONoption to build the Snowflake driver.
- Add
- Place the resulting object file into your dynamic loader path or set
LD_LIBRARY_PATH/DYLD_LIBRARY_PATHappropriately. - Set
ADBC_SNOWFLAKE_GO_LIB_DIRappropriately. - Run
cargo test --all-features --workspace
Writing Drivers
To write an ADBC driver in Rust you have to:
- Create a new library crate with
crate-type = ["lib", "cdylib"]. - Implement the abstract API which consists of the traits
Driver,Database,ConnectionandStatement. - Export your driver to C with the macro
adbc_ffi::export_driver!.
The resulting object file can then be loaded by other languages through their own driver manager.
Dependencies
~7.5MB
~138K SLoC