| Crates.io | asqlite |
| lib.rs | asqlite |
| version | 1.2.0 |
| created_at | 2025-02-06 22:35:37.460803+00 |
| updated_at | 2025-06-29 14:04:44.861089+00 |
| description | SQLite wrapper using async Rust |
| homepage | |
| repository | https://github.com/nicbn/asqlite |
| max_upload_size | |
| id | 1546173 |
| size | 177,475 |
This crate provides an API for accessing SQLite databases using async Rust.
It wraps the libsqlite3 library.
⚠️ DISCLAIMER: this crate is not associated with the mantainers or trademark owners of the official SQLite3 library.
// Create an in-memory database connection with the name :memory
let mut conn = asqlite::Connection::builder()
.create(true) // create if it does not exists
.write(true) // read and write
.open_memory(":memory") // to open a file, use .open(path)
.await?;
// Create a table
conn.execute(
"CREATE TABLE fruit (name TEXT, color TEXT)",
(), // no parameters
)
.await?;
// ...
// Check all red fruits
let mut rows = conn.query(
"SELECT name FROM fruit WHERE color = ?",
asqlite::params!("red"),
);
// Iterate rows
while let Some(row) = rows.next().await {
let name: String = row?;
println!("{} is red", name);
}
Currently the Minimum Supported Rust Version (MSRV) is 1.82. This version may be increased in the future with a minor release bump.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.