gel-tokio

Crates.iogel-tokio
lib.rsgel-tokio
version0.11.0
created_at2025-01-14 18:30:29.926898+00
updated_at2025-06-25 23:01:43.833443+00
description Gel database client implementation for tokio. Formerly published as gel-tokio.
homepage
repository
max_upload_size
id1516441
size260,430
EdgeDB CI and Release Bot (edgedb-ci)

documentation

README

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.

Commit count: 0

cargo fmt