Packages / rupm

rs-db-driver-odbc-odbc-api 0.1.0

Any database with an ODBC driver: odbc-api (the driver, re-exported, with a runnable example)

Install

cargo add rs-db-driver-odbc-odbc-api --registry rupm

In Ruststudio: Packages, search for rs-db-driver-odbc-odbc-api, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-db-driver-odbc-odbc-api

Any database with an ODBC driver - odbc-api: ODBC for Db2, Teradata, SAP HANA, Informix, Snowflake and more

Add it with `rupm add rs-db-driver-odbc-odbc-api` (or `cargo add rs-db-driver-odbc-odbc-api --registry rupm`). The driver `odbc-api` is re-exported as `rs_db_driver_odbc_odbc_api::odbc_api`.

Also serves: IBM Db2, Teradata, SAP HANA, Informix, Snowflake, Firebird, Sybase, SQL Server

**Needs on the PC:** the database's ODBC driver and an ODBC driver manager (built into Windows)

## Example

```rust
use odbc_api::{ConnectionOptions, Environment};

fn main() -> Result<(), odbc_api::Error> {
    let env = Environment::new()?;
    // Use the connection string of your driver (see the ODBC Data Source Administrator for its name).
    let conn = env.connect_with_connection_string("Driver={ODBC Driver 18 for SQL Server};Server=localhost;UID=sa;PWD=YourStrong!Passw0rd;TrustServerCertificate=yes;", ConnectionOptions::default())?;
    conn.execute("SELECT 1", (), None)?;
    println!("connected");
    Ok(())
}
```