71 releases
| new 0.12.0 | Apr 17, 2026 |
|---|---|
| 0.10.4 | Apr 17, 2026 |
| 0.10.2 | Mar 27, 2026 |
| 0.10.1 | Oct 20, 2025 |
| 0.0.15 | Mar 31, 2022 |
#1684 in Database interfaces
224,914 downloads per month
Used in ydb-steroids
1MB
25K
SLoC
Rust YDB SDK 
Rust SDK for YDB. Supported rust: 1.82 and newer.
Integration tests, with dependency from real YDB database mark as ignored. For run it:
- Set YDB_CONNECTION_STRING env
- run cargo test -- --ignored
Cargo feature force-exhaustive-all
disable all non_exhaustive marks in public interface for force check new variants at compile time instead of runtime.
lib.rs:
YDB SDK - a client for YDB.
Example
#
// create driver
let client = ClientBuilder::new_from_connection_string("grpc://localhost:2136?database=local")?
.with_credentials(StaticToken::from("asd"))
.client()?;
// wait until driver background initialization finish
client.wait().await?;
// read query result
let sum: i32 = client
.table_client() // create table client
.retry_transaction(|mut t| async move {
// code in transaction can retry few times if was some retriable error
// send query to database
let res = t.query(Query::from("SELECT 1 + 1 AS sum")).await?;
// read exact one result from db
let field_val: i32 = res.into_only_row()?.remove_field_by_name("sum")?.try_into()?;
// return result
return Ok(field_val);
})
.await?;
// it will print "sum: 2"
println!("sum: {}", sum);
More examples
Dependencies
~29–50MB
~771K SLoC