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

#194 in Database interfaces

Download history 80/week @ 2024-03-14 42/week @ 2024-03-21 60/week @ 2024-03-28 130/week @ 2024-04-04 52/week @ 2024-04-11 35/week @ 2024-04-18 79/week @ 2024-04-25 109/week @ 2024-05-02 179/week @ 2024-05-09 76/week @ 2024-05-16 114/week @ 2024-05-23 100/week @ 2024-05-30 159/week @ 2024-06-06 249/week @ 2024-06-13 107/week @ 2024-06-20 78/week @ 2024-06-27

601 downloads per month
Used in 2 crates

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–28MB
~529K SLoC