2 unstable releases

0.15.0 Nov 13, 2024
0.14.0 Sep 5, 2024

#1920 in Database interfaces

Download history 157/week @ 2024-09-02 17/week @ 2024-09-09 5/week @ 2024-09-16 5/week @ 2024-09-23 3/week @ 2024-09-30 21/week @ 2024-10-07 5/week @ 2024-10-14 19/week @ 2024-10-28 47/week @ 2024-11-04 132/week @ 2024-11-11

199 downloads per month

Apache-2.0

220KB
4K SLoC

ADBC: Arrow Database Connectivity

ADBC is a set of APIs and libraries for Arrow-native access to databases. Execute SQL and Substrait queries, query database catalogs, and more, all using Arrow data to eliminate unnecessary data copies, speed up access, and make it more convenient to build analytical applications.

Read more about ADBC at https://arrow.apache.org/adbc/

This library 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.

Native Rust drivers

Native Rust drivers will implement the abstract API consisting of the traits:

  • [Driver]
  • [Database]
  • [Connection]
  • [Statement]

For drivers implemented in Rust, using these will be more efficient and safe, since it avoids the overhead of going through C FFI.

Driver Manager

The [driver_manager] module allows loading drivers exposing the C API, either from an initialization function (link-time, either static or dynamic) or by dynamically finding such a function in a dynamic library (run-time). The driver manager is gated behind the driver_manager feature flag.

Driver Exporter

The driver exporter allows exposing native Rust drivers as C drivers to be used by other langages via their own driver manager. Once you have an implementation of [Driver], provided that it also implements [Default], you can build it as an object file implementing the C API with the [export_driver] macro.

Dependencies

~5–11MB
~111K SLoC