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

#1088 in Database interfaces

Download history 110/week @ 2024-07-21 104/week @ 2024-07-28 65/week @ 2024-08-04 163/week @ 2024-08-11 101/week @ 2024-08-18 213/week @ 2024-08-25 102/week @ 2024-09-01 63/week @ 2024-09-08 84/week @ 2024-09-15 178/week @ 2024-09-22 147/week @ 2024-09-29 156/week @ 2024-10-06 145/week @ 2024-10-13 68/week @ 2024-10-20 56/week @ 2024-10-27 130/week @ 2024-11-03

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