#access #sql-query #ffi #unix #mdb

mdbsql

SQL query for Access database on Unix-like systems

3 releases

0.1.7 Jan 3, 2024
0.1.6 Nov 19, 2023
0.1.5 Apr 26, 2023
0.1.4 Dec 29, 2022
0.1.2 Sep 23, 2022

#1472 in Database interfaces

Apache-2.0

26KB
609 lines

mdbsql

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.


lib.rs:

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");
};

Dependencies

~1.4–7.5MB
~145K SLoC