3 releases
0.1.7 | Jan 3, 2024 |
---|---|
0.1.6 |
|
0.1.5 |
|
0.1.4 |
|
0.1.2 | Sep 23, 2022 |
#1495 in Database interfaces
61 downloads per month
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