#client-database #tokio-client #tokio-runtime #gel #transaction

gel-tokio

Gel database client implementation for tokio. Formerly published as gel-tokio

28 releases (5 breaking)

0.11.0 Jun 25, 2025
0.10.15 May 16, 2025
0.10.4 Mar 24, 2025

#1437 in Database interfaces

Download history 785/week @ 2025-10-04 725/week @ 2025-10-11 685/week @ 2025-10-18 408/week @ 2025-10-25 414/week @ 2025-11-01 484/week @ 2025-11-08 436/week @ 2025-11-15 454/week @ 2025-11-22 400/week @ 2025-11-29 318/week @ 2025-12-06 337/week @ 2025-12-13 385/week @ 2025-12-20 280/week @ 2025-12-27 298/week @ 2026-01-03 289/week @ 2026-01-10 352/week @ 2026-01-17

1,274 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

160KB
3.5K SLoC

Gel Rust Binding for Tokio

Async client for the Gel database, using Tokio runtime.

Example Usage

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let conn = gel_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 = gel_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

Version Support

Gel protocol version 0 support was removed in 0.11.x.

License

Licensed under either of

at your option.

Dependencies

~34–51MB
~805K SLoC