7 releases (4 breaking)

0.5.1 May 9, 2024
0.5.0 Jun 22, 2023
0.4.0 May 15, 2023
0.3.0 Jul 27, 2022
0.0.0 Jan 28, 2022

#1521 in Database interfaces

Download history 120/week @ 2024-09-18 166/week @ 2024-09-25 136/week @ 2024-10-02 149/week @ 2024-10-09 150/week @ 2024-10-16 46/week @ 2024-10-23 83/week @ 2024-10-30 142/week @ 2024-11-06 97/week @ 2024-11-13 110/week @ 2024-11-20 80/week @ 2024-11-27 105/week @ 2024-12-04 162/week @ 2024-12-11 169/week @ 2024-12-18 60/week @ 2024-12-25 130/week @ 2025-01-01

565 downloads per month
Used in 5 crates (4 directly)

MIT/Apache

255KB
6K SLoC

EdgeDB Rust Binding for Tokio

Work in progress asynchronous bindings of EdgeDB for Tokio main loop.

Example Usage

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let conn = edgedb_tokio::create_client().await?;
    let val = conn.query_required_single::<i64, _>(
        "SELECT 7*8",
        &(),
    ).await?;
    println!("7*8 is: {}", val);
    Ok(())
}

Transaction Example

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let conn = edgedb_tokio::create_client().await?;
    let val = conn.transaction(|mut transaction| async move {
        transaction.query_required_single::<i64, _>(
            "SELECT (UPDATE Counter SET { value := .value + 1}).value LIMIT 1",
            &()
        ).await
    }).await?;
    println!("Counter: {val}");
    Ok(())
}

More examples on github

License

Licensed under either of

at your option.

Dependencies

~16–29MB
~536K SLoC