6 releases (breaking)

0.5.0 Jun 22, 2023
0.4.0 May 15, 2023
0.3.0 Jul 27, 2022
0.2.1 Apr 27, 2022
0.0.0 Jan 28, 2022

#1450 in Database interfaces

Download history 39/week @ 2023-11-20 42/week @ 2023-11-27 19/week @ 2023-12-04 30/week @ 2023-12-11 39/week @ 2023-12-18 97/week @ 2023-12-25 53/week @ 2024-01-01 52/week @ 2024-01-08 60/week @ 2024-01-15 26/week @ 2024-01-22 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

493 downloads per month
Used in edgedb-composable-query

MIT/Apache

240KB
5.5K 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

~18–33MB
~623K SLoC