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

#229 in Database interfaces

Download history 59/week @ 2024-01-29 94/week @ 2024-02-05 108/week @ 2024-02-12 154/week @ 2024-02-19 112/week @ 2024-02-26 100/week @ 2024-03-04 87/week @ 2024-03-11 52/week @ 2024-03-18 36/week @ 2024-03-25 118/week @ 2024-04-01 80/week @ 2024-04-08 50/week @ 2024-04-15 56/week @ 2024-04-22 110/week @ 2024-04-29 188/week @ 2024-05-06 52/week @ 2024-05-13

410 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