7 releases (4 breaking)

new 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

#1867 in Database interfaces

Download history 45/week @ 2024-01-17 39/week @ 2024-01-24 56/week @ 2024-01-31 107/week @ 2024-02-07 153/week @ 2024-02-14 116/week @ 2024-02-21 107/week @ 2024-02-28 90/week @ 2024-03-06 85/week @ 2024-03-13 48/week @ 2024-03-20 60/week @ 2024-03-27 122/week @ 2024-04-03 49/week @ 2024-04-10 44/week @ 2024-04-17 79/week @ 2024-04-24 92/week @ 2024-05-01

284 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
~540K SLoC