Crates.io | gel-tokio |
lib.rs | gel-tokio |
version | 0.11.0 |
created_at | 2025-01-14 18:30:29.926898+00 |
updated_at | 2025-06-25 23:01:43.833443+00 |
description | Gel database client implementation for tokio. Formerly published as gel-tokio. |
homepage | |
repository | |
max_upload_size | |
id | 1516441 |
size | 260,430 |
Async client for the Gel database, using Tokio runtime.
#[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(())
}
#[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
Gel protocol version 0 support was removed in 0.11.x.
Licensed under either of
at your option.