Expand description
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
Macros§
- sugar for manual construct query params
- Sugar for manual construct structs Example:
Structs§
- Credentials with static token without renewing
- Builder for
AcquireOptions
. - YDB client
- Get from stdout of command
- Builder for
DescribeOptions
. - Current discovery state
- Get instance service account token from GCE instance
- Get token of service account of instance
- Builder for
NodeConfig
. - Query object
- Retry options
- Get service account credentials instance service account key should be:
- Builder for
SessionOptions
. - Always discovery once static node
- Client for YDB table service (SQL queries)
- TopicWriter at initial state of implementation it really doesn’t ready for use. For example It isn’t handle lost connection to the server and have some unimplemented method.
- Builder for
TopicWriterMessage
. - Builder for
TopicWriterOptions
. - Options for create transaction
- Builder for
WatchOptions
. - Describe issue from server
- Describe operation status from server
Enums§
- Internal represent database value for send to or received from database.
- Error which can be returned from the crate.
- Severity of issue
- Error for wrap user errors while return it from callback
Traits§
- Discovery YDB endpoints
Type Aliases§
- CommandLineYcTokenDeprecated
- StaticCredentialsAuthDeprecated
- StaticTokenDeprecated
- YandexMetadataDeprecated
- T result or YdbError as Error
- T result or YdbOrCustomerError as Error