Crate mdbsql

source ·
Expand description

SQL query for Access database on Unix-like systems.

This is a simple wrapper for libmdbsql in Rust.

The implemented SQL subset is limited, please refer to mdb-sql.

Example

use mdbsql::{Connection, Error};

let conn = Connection::open(path)?;
let rows = conn.prepare("SELECT ID, A FROM Table1 WHERE ID = 1")?;
let col_names: Vec<String> = rows
    .columns()
    .iter()
    .map(|c| c.name())
    .collect();

assert_eq!(col_names, vec!["ID", "A"]);

for row in rows {
    let col1: u32 = row.get(0)?;
    let col2: String = row.get(1)?;
    assert_eq!(col1, 1);
    assert_eq!(col2, "Foo");
};

Re-exports

Modules

Enums

  • Enum listing for errors from mdbsql.