From 582241fae5ced217aa0d871f1bf9e26bcac7d777 Mon Sep 17 00:00:00 2001 From: Timofey Koolin Date: Thu, 23 Jan 2025 09:25:04 +0000 Subject: [PATCH] add rust init driver example --- ydb/docs/en/core/recipes/ydb-sdk/init.md | 8 ++++++++ ydb/docs/ru/core/recipes/ydb-sdk/init.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ydb/docs/en/core/recipes/ydb-sdk/init.md b/ydb/docs/en/core/recipes/ydb-sdk/init.md index ddedf57e77a4..2a95b53a926a 100644 --- a/ydb/docs/en/core/recipes/ydb-sdk/init.md +++ b/ydb/docs/en/core/recipes/ydb-sdk/init.md @@ -140,4 +140,12 @@ Below are examples of the code for connecting to {{ ydb-short-name }} (driver cr $ydb = new Ydb($config); ``` +- Rust + + ```rust + let client = ClientBuilder::new_from_connection_string("grpc://localhost:2136?database=local")? + .with_credentials(AccessTokenCredentials::from("...")) + .client()? + ``` + {% endlist %} diff --git a/ydb/docs/ru/core/recipes/ydb-sdk/init.md b/ydb/docs/ru/core/recipes/ydb-sdk/init.md index 21b281175edb..467563d09575 100644 --- a/ydb/docs/ru/core/recipes/ydb-sdk/init.md +++ b/ydb/docs/ru/core/recipes/ydb-sdk/init.md @@ -164,4 +164,12 @@ $ydb = new Ydb($config); ``` +- Rust + + ```rust + let client = ClientBuilder::new_from_connection_string("grpc://localhost:2136?database=local")? + .with_credentials(AccessTokenCredentials::from("...")) + .client()? + ``` + {% endlist %}