Packages / rupm

rs-db-driver-sqlite-sqlx 0.1.0

SQLite: sqlx (the driver, re-exported, with a runnable example)

Install

cargo add rs-db-driver-sqlite-sqlx --registry rupm

In Ruststudio: Packages, search for rs-db-driver-sqlite-sqlx, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-db-driver-sqlite-sqlx

SQLite - sqlx: async SQL toolkit

Add it with `rupm add rs-db-driver-sqlite-sqlx` (or `cargo add rs-db-driver-sqlite-sqlx --registry rupm`). The driver `sqlx` is re-exported as `rs_db_driver_sqlite_sqlx::sqlx`.

**Needs on the PC:** a C compiler (SQLite is compiled with your program)

This driver is async: your project also needs an async runtime, for example `cargo add tokio --features macros,rt-multi-thread`.

## Example

```rust
use sqlx::sqlite::SqlitePoolOptions;

#[tokio::main]
async fn main() -> Result<(), sqlx::Error> {
    // mode=rwc creates app.db when it is missing.
    let pool = SqlitePoolOptions::new().connect("sqlite://app.db?mode=rwc").await?;
    let row: (i64,) = sqlx::query_as("SELECT 1").fetch_one(&pool).await?;
    println!("the database answered {}", row.0);
    Ok(())
}
```