2 unstable releases

0.15.0 Nov 13, 2024
0.14.0 Sep 5, 2024

#1956 in Database interfaces

Download history 160/week @ 2024-09-03 15/week @ 2024-09-10 5/week @ 2024-09-17 4/week @ 2024-09-24 6/week @ 2024-10-01 19/week @ 2024-10-08 4/week @ 2024-10-15 5/week @ 2024-10-22 29/week @ 2024-10-29 32/week @ 2024-11-05 136/week @ 2024-11-12 41/week @ 2024-11-19

177 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–10MB
~110K SLoC