#edgedb #tokio #async

edgedb-tokio

EdgeDB database client implementation for tokio

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

#1147 in Database interfaces

Download history 79/week @ 2023-10-31 76/week @ 2023-11-07 104/week @ 2023-11-14 89/week @ 2023-11-21 108/week @ 2023-11-28 48/week @ 2023-12-05 81/week @ 2023-12-12 123/week @ 2023-12-19 125/week @ 2023-12-26 100/week @ 2024-01-02 99/week @ 2024-01-09 104/week @ 2024-01-16 67/week @ 2024-01-23 113/week @ 2024-01-30 146/week @ 2024-02-06 157/week @ 2024-02-13

494 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

~19–34MB
~641K SLoC