Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
adbcBridge for Rust
Find and load adbcBridge -- the
ADBC driver for any ODBC data source -- through the adbc_driver_manager
crate.
[]
= "0.1"
= "0.24"
The crate has two functions:
adbcbridge::driver_path() -> Result<PathBuf, Error>returns the absolute path oflibadbc_driver_odbc(.so/.dylib/.dll). Lookup order: theADBCBRIDGE_LIBRARYthenADBC_ODBC_DRIVERenvironment variables; the copy compiled by thebundledfeature; the ADBC driver manifest namedodbc(odbc.toml) in the driver manager's search directories; and finally the usual install directories ($VIRTUAL_ENV/lib,/usr/local/lib,/usr/lib, ...) plus a CMakebuild/tree next to a source checkout.adbcbridge::load() -> Result<ManagedDriver, Error>loads that library into the ADBC driver manager (entry pointAdbcDriverInit, ADBC 1.1.0). The result is an ordinaryadbc_driver_manager::ManagedDriver; the ODBC connection string is passed as the ADBCurioption.load_from(path)does the same for a library you have already located.
use OptionDatabase;
use ;
let mut driver = load?;
let uri = "Driver=/usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so;Database=:memory:;";
let database = driver.new_database_with_opts?;
let mut connection = database.new_connection?;
let mut statement = connection.new_statement?;
statement.set_sql_query?;
for batch in statement.execute?
The bundled feature (default)
With bundled on, build.rs compiles the driver from the C sources shipped
in the crate (csrc/, a verbatim copy of the repository's src/, include/
and vendor/nanoarrow/) and links it against the ODBC driver manager, so the
only prerequisites are a C compiler and the ODBC driver-manager development
files:
- Debian/Ubuntu:
apt install unixodbc-dev - Fedora/RHEL:
dnf install unixODBC-devel - macOS:
brew install unixodbc - Windows:
odbc32from the Windows SDK, nothing to install.
ADBCBRIDGE_ODBC_LIB (for example iodbc), ADBCBRIDGE_ODBC_INCLUDE_DIR and
ADBCBRIDGE_ODBC_LIB_DIR override where the build looks for the driver
manager.
cargo add adbcbridge --no-default-features gives the loader only: you then
supply libadbc_driver_odbc yourself (set ADBC_ODBC_DRIVER, or
cmake --install the driver) and driver_path() finds it as described above.
Developing
csrc/ is refreshed from the repository root with ./sync-csrc.sh; the
csrc_in_sync test fails when the copy has drifted. The sqlite test runs
SELECT 1 through the SQLite ODBC driver named by SQLITE_ODBC_DRIVER and
is skipped when that variable is unset.