From 73bbb38fa32fe627eb4484fcde1b0ede4ad56920 Mon Sep 17 00:00:00 2001 From: Yiran Date: Tue, 3 Sep 2024 00:40:10 +0800 Subject: [PATCH] chore: refine the connection description for SDKs (#1158) --- docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md | 1 + docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md | 6 +++--- .../current/user-guide/ingest-data/for-iot/grpc-sdks/go.md | 1 + .../user-guide/ingest-data/for-iot/grpc-sdks/template.md | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md b/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md index c5c7e6516..15b8a073b 100644 --- a/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md +++ b/docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md @@ -43,6 +43,7 @@ cfg := greptime.NewConfig("127.0.0.1"). // Enable secure connection if your server is secured by TLS // WithInsecure(false). // set authentication information + // If the database doesn't require authentication, just remove the WithAuth method WithAuth("username", "password") cli, _ := greptime.NewClient(cfg) diff --git a/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md b/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md index e8d6069f6..c6c4734e5 100644 --- a/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md +++ b/docs/user-guide/ingest-data/for-iot/grpc-sdks/template.md @@ -12,9 +12,9 @@ For more information, refer to [Automatic Schema Generation](/user-guide/ingest- ## Connect to database -Username and password are always required to connect to GreptimeDB. -For how to set authentication to GreptimeDB, see [Authentication](/user-guide/clients/authentication.md). -Here we set the username and password when using the library to connect to GreptimeDB. +If you have set the [`--user-provider` configuration](/user-guide/clients/authentication.md) when starting GreptimeDB, +you will need to provide a username and password to connect to GreptimeDB. +The following example shows how to set the username and password when using the library to connect to GreptimeDB. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md index 9760cf3f2..f808cc882 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/go.md @@ -42,6 +42,7 @@ cfg := greptime.NewConfig("127.0.0.1"). // 如果服务配置了 TLS ,设置 TLS 选项来启用安全连接 // WithInsecure(false). // 设置鉴权信息 + // 如果数据库不需要鉴权,移除 WithAuth 方法即可 WithAuth("username", "password") cli, _ := greptime.NewClient(cfg) diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md index 8863dd202..a9850e78a 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/ingest-data/for-iot/grpc-sdks/template.md @@ -11,9 +11,9 @@ GreptimeDB 提供了用于高吞吐量数据写入的 ingester 库。 ## 连接数据库 -连接 GreptimeDB 时,通常需要用户名和密码。 -关于如何设置 GreptimeDB 的鉴权方式,请参考[鉴权](/user-guide/clients/authentication.md)。 -这里我们在使用 ingester 库连接 GreptimeDB 时设置用户名和密码。 +如果你在启动 GreptimeDB 时设置了 [`--user-provider`](/user-guide/clients/authentication.md), +则需要提供用户名和密码才能连接到 GreptimeDB。 +以下示例显示了使用 SDK 连接到 GreptimeDB 时如何设置用户名和密码。