1 unstable release
0.14.0 | Sep 5, 2024 |
---|
#2650 in Database interfaces
45 downloads per month
215KB
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
~12–19MB
~262K SLoC