Skip to content

nicbn/asqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asqlite - Async SQLite wrapper for Rust

Crates.io Version docs.rs GitHub Actions Workflow Status

This crate provides an API for accessing SQLite databases using async Rust.

It wraps the libsqlite3 library.

Documentation

⚠️ DISCLAIMER: this crate is not associated with the mantainers or trademark owners of the official SQLite3 library.

Example

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

See the entire example

Minimum Supported Rust Version

Currently the Minimum Supported Rust Version (MSRV) is 1.82. This version may be increased in the future with a minor release bump.

License

Licensed under either of

at your option.

Contribution

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.

About

SQLite wrapper using async Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages