4 releases (breaking)

new 0.17.0 Mar 7, 2025
0.16.0 Jan 21, 2025
0.15.0 Nov 13, 2024
0.14.0 Sep 5, 2024

#1649 in Database interfaces

Download history 41/week @ 2024-11-19 3/week @ 2024-12-31 9/week @ 2025-01-07 11/week @ 2025-01-14 113/week @ 2025-01-21 31/week @ 2025-01-28 30/week @ 2025-02-04 4/week @ 2025-02-11 39/week @ 2025-02-18 40/week @ 2025-02-25 143/week @ 2025-03-04

227 downloads per month
Used in hyprstream

Apache-2.0

220KB
4K SLoC

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:

  1. Install SQLite and have its dynamic library in path.
  2. Build the official ADBC SQLite driver by following the documentation.
  3. Place the resulting object file into your dynamic loader path or set LD_LIBRARY_PATH/DYLD_LIBRARY_PATH appropriately.
  4. Run cargo test --all-features --workspace

Writing Drivers

To write an ADBC driver in Rust you have to:

  1. Create a new library crate with crate-type = ["lib", "cdylib"].
  2. Implement the abstract API which consists of the traits Driver, Database, Connection and Statement.
  3. Export your driver to C with the macro adbc_core::export_driver!.

The resulting object file can then be loaded by other languages trough their own driver manager.

Dependencies

~6–11MB
~117K SLoC