Skip to content

Commit 53316ec

Browse files
authored
feat: Updated docusaurus to 3.4 (#970)
1 parent bd2c791 commit 53316ec

File tree

330 files changed

+26371
-9836
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+26371
-9836
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.12.1
1+
22.3.0

README.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Welcome to the official documentation repository for Databend! We invite you to
1414

1515
The Databend docs are thoughtfully organized to provide users with a structured and comprehensive resource. Navigating through the documentation page at [https://docs.databend.com/](https://docs.databend.com/), you'll find key information categorized into distinct tabs. Each tab serves a specific purpose, offering detailed insights into different aspects of Databend:
1616

17-
| Tab | Folder in this Repo | Description |
18-
|----------------|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19-
| Guides | [docs/guides](https://github.com/datafuselabs/databend-docs/tree/main/docs/en/guides) | Includes insights into the core features, data import/export, third-party tool integration, and programming interfaces across all Databend editions. Additionally, it offers valuable information on deploying Databend on-premises. |
20-
| Databend Cloud | [docs/guides/cloud](https://github.com/datafuselabs/databend-docs/tree/main/docs/en/guides/20-cloud) | Includes details on account registration, operational guidance, and organization management tailored for Databend Cloud. Whether you're new to the cloud environment or an experienced user, contribute here to share your insights. |
17+
| Tab | Folder in this Repo | Description |
18+
| -------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
19+
| Guides | [docs/guides](https://github.com/datafuselabs/databend-docs/tree/main/docs/en/guides) | Includes insights into the core features, data import/export, third-party tool integration, and programming interfaces across all Databend editions. Additionally, it offers valuable information on deploying Databend on-premises. |
20+
| Databend Cloud | [docs/guides/cloud](https://github.com/datafuselabs/databend-docs/tree/main/docs/en/guides/20-cloud) | Includes details on account registration, operational guidance, and organization management tailored for Databend Cloud. Whether you're new to the cloud environment or an experienced user, contribute here to share your insights. |
2121
| SQL Reference | [docs/sql-reference](https://github.com/datafuselabs/databend-docs/tree/main/docs/en/sql-reference) | Explains Databend general essentials and a variety of available SQL functions and commands. Contribute to this section to help fellow users navigate the world of SQL in Databend. |
22-
| Releases | - | Contains release notes for Databend Cloud and updates on nightly builds. |
22+
| Releases | - | Contains release notes for Databend Cloud and updates on nightly builds. |
2323

2424
## What You can Contribute
2525

@@ -30,21 +30,25 @@ Share your expertise by contributing documents for new functions or commands you
3030
To ensure a smooth collaboration process, we recommend following these best practices:
3131

3232
1. Fork and Branch:
33-
- We recommend forking the repository on GitHub and creating a new branch for your edits. This allows for better version control and easier tracking of changes.
34-
- Edit the documentation on your branch and submit a Pull Request (PR) when you are ready for review.
3533

36-
2. Follow Existing Formats: For consistency, follow the existing documentation format. For example, if you are adding documentation for a new function, consider copying an existing markdown file from the same folder and modifying it accordingly.
34+
- We recommend forking the repository on GitHub and creating a new branch for your edits. This allows for better version control and easier tracking of changes.
35+
- Edit the documentation on your branch and submit a Pull Request (PR) when you are ready for review.
36+
37+
2. Follow Existing Formats: For consistency, follow the existing documentation format. For example, if you are adding documentation for a new function, consider copying an existing markdown file from the same folder and modifying it accordingly.
3738

3839
3. Preview Locally:
39-
- To preview your changes locally and ensure they meet your expectations, ensure you have [Node.js](https://nodejs.org/) installed on your machine. Run the following commands in your terminal to initiate a local preview:
40-
40+
41+
- To preview your changes locally and ensure they meet your expectations, ensure you have [Node.js](https://nodejs.org/)(Please install a version greater than 20) installed on your machine. Run the following commands in your terminal to initiate a local preview:
42+
4143
```bash
4244
yarn install
4345
```
46+
4447
```bash
4548
yarn run dev
4649
```
47-
- Confirm that the formatting is correct, links work as intended, and the content aligns with your vision BEFORE you submit.
50+
51+
- Confirm that the formatting is correct, links work as intended, and the content aligns with your vision BEFORE you submit.
4852

4953
## Versioning
5054

api/cron.js

-10
This file was deleted.

docs/cn/developer/00-drivers/00-golang.md

+60-62
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,78 @@ title: Golang
55
import StepsWrap from '@site/src/components/StepsWrap';
66
import StepContent from '@site/src/components/Steps/step-content';
77

8-
Databend提供了一个用Golang编写的驱动程序(databend-go),方便使用Golang编程语言开发应用程序,并建立与Databend的连接
8+
Databend 提供了一个用 Golang 编写的驱动程序(databend-go),方便使用 Golang 编程语言开发应用程序,并建立与 Databend 的连接
99

10-
关于安装说明、示例和源代码,请参阅GitHub上的[databend-go](https://github.com/datafuselabs/databend-go)仓库。
10+
关于安装说明、示例和源代码,请参阅 GitHub 上的[databend-go](https://github.com/datafuselabs/databend-go)仓库。
1111

1212
## 数据类型映射
1313

14-
下表展示了Databend数据类型与其对应的Go数据类型之间的映射关系
14+
下表展示了 Databend 数据类型与其对应的 Go 数据类型之间的映射关系
1515

16-
| Databend | Go |
17-
|----------------|---------------|
18-
| TINYINT | int8 |
19-
| SMALLINT | int16 |
20-
| INT | int32 |
21-
| BIGINT | int64 |
22-
| TINYINT UNSIGNED | uint8 |
23-
| SMALLINT UNSIGNED | uint16 |
24-
| INT UNSIGNED | uint32 |
25-
| BIGINT UNSIGNED| uint64 |
26-
| Float32 | float32 |
27-
| Float64 | float64 |
28-
| Bitmap | string |
29-
| Decimal | decimal.Decimal |
30-
| String | string |
31-
| Date | time.Time |
32-
| DateTime | time.Time |
33-
| Array(T) | string |
34-
| Tuple(T1, T2, ...) | string |
35-
| Variant | string |
16+
| Databend | Go |
17+
| ------------------ | --------------- |
18+
| TINYINT | int8 |
19+
| SMALLINT | int16 |
20+
| INT | int32 |
21+
| BIGINT | int64 |
22+
| TINYINT UNSIGNED | uint8 |
23+
| SMALLINT UNSIGNED | uint16 |
24+
| INT UNSIGNED | uint32 |
25+
| BIGINT UNSIGNED | uint64 |
26+
| Float32 | float32 |
27+
| Float64 | float64 |
28+
| Bitmap | string |
29+
| Decimal | decimal.Decimal |
30+
| String | string |
31+
| Date | time.Time |
32+
| DateTime | time.Time |
33+
| Array(T) | string |
34+
| Tuple(T1, T2, ...) | string |
35+
| Variant | string |
3636

37-
## Databend Go驱动程序行为概述
37+
## Databend Go 驱动程序行为概述
3838

39-
Databend Go驱动程序与["database/sql"](https://pkg.go.dev/database/sql)接口规范兼容。以下是一些常见基本行为,以及涉及的关键函数和背后的原理。
39+
Databend Go 驱动程序与["database/sql"](https://pkg.go.dev/database/sql)接口规范兼容。以下是一些常见基本行为,以及涉及的关键函数和背后的原理。
4040

41-
| 基本行为 | 涉及的关键函数 | 原理 |
42-
|------------------|--------------------------------------------|--------------------------------------------------------|
43-
| 创建连接 | `DB.Open` | 使用DSN字符串和`DB.Open`方法建立与Databend的连接。<br /><br />DSN字符串格式为`https://user:password@host/database?<query_option>=<value>`|
44-
| 执行语句 | `DB.Exec` | 使用`DB.Exec`方法通过`v1/query`接口执行SQL语句,用于创建、删除表和插入数据。 |
45-
| 批量插入 | `DB.Begin`, `Tx.Prepare`, `Stmt.Exec`, `Tx.Commit` | 批量插入/替换数据(`INSERT INTO``REPLACE INTO`)通过事务处理。<br /><br />使用`Stmt.Exec`向预处理语句对象添加尽可能多的数据;数据将被附加到文件中。<br /><br />执行`Tx.Commit()`将最终将数据上传到内置Stage并执行插入/替换操作,使用[Stage附件](/developer/apis/http#stage-attachment)|
46-
| 查询单行 | `DB.QueryRow`, `Row.Scan` | 使用`DB.QueryRow`方法查询单行数据并返回`*sql.Row`,然后调用`Row.Scan`将列数据映射到变量。 |
47-
| 遍历行 | `DB.Query`, `Rows.Next`, `Rows.Scan` | 使用`DB.Query`方法查询多行数据并返回`*sql.Rows`结构,使用`Rows.Next`方法遍历行,使用`Rows.Scan`将数据映射到变量。 |
48-
| 上传到内部Stage | `APIClient.UploadToStage` | 上传数据到Stage。默认情况下,使用`PRESIGN UPLOAD`获取URL,如果PRESIGN被禁用,则使用`v1/upload_to_stage` API。 |
41+
| 基本行为 | 涉及的关键函数 | 原理 |
42+
| ---------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43+
| 创建连接 | `DB.Open` | 使用 DSN 字符串和`DB.Open`方法建立与 Databend 的连接。<br /><br />DSN 字符串格式为`https://user:password@host/database?<query_option>=<value>` |
44+
| 执行语句 | `DB.Exec` | 使用`DB.Exec`方法通过`v1/query`接口执行 SQL 语句,用于创建、删除表和插入数据。 |
45+
| 批量插入 | `DB.Begin`, `Tx.Prepare`, `Stmt.Exec`, `Tx.Commit` | 批量插入/替换数据(`INSERT INTO``REPLACE INTO`)通过事务处理。<br /><br />使用`Stmt.Exec`向预处理语句对象添加尽可能多的数据;数据将被附加到文件中。<br /><br />执行`Tx.Commit()`将最终将数据上传到内置 Stage 并执行插入/替换操作,使用[Stage 附件](/developer/apis/http#stage-attachment)|
46+
| 查询单行 | `DB.QueryRow`, `Row.Scan` | 使用`DB.QueryRow`方法查询单行数据并返回`*sql.Row`,然后调用`Row.Scan`将列数据映射到变量。 |
47+
| 遍历行 | `DB.Query`, `Rows.Next`, `Rows.Scan` | 使用`DB.Query`方法查询多行数据并返回`*sql.Rows`结构,使用`Rows.Next`方法遍历行,使用`Rows.Scan`将数据映射到变量。 |
48+
| 上传到内部 Stage | `APIClient.UploadToStage` | 上传数据到 Stage。默认情况下,使用`PRESIGN UPLOAD`获取 URL,如果 PRESIGN 被禁用,则使用`v1/upload_to_stage` API。 |
4949

50-
## 教程-1:使用Golang与Databend集成
50+
## 教程 -1:使用 Golang 与 Databend 集成
5151

52-
开始之前,请确保您已成功安装本地Databend。详细说明请参阅[本地和Docker部署](/guides/deploy/deploy/non-production/deploying-local)
52+
开始之前,请确保您已成功安装本地 Databend。详细说明请参阅[本地和 Docker 部署](/guides/deploy/deploy/non-production/deploying-local)
5353

54-
### 步骤1. 准备SQL用户账户
54+
### 步骤 1. 准备 SQL 用户账户
5555

56-
要将程序连接到Databend并执行SQL操作,您必须在代码中提供具有适当权限的SQL用户账户。如有需要,在Databend中创建一个,并确保SQL用户只有必要的权限以保证安全
56+
要将程序连接到 Databend 并执行 SQL 操作,您必须在代码中提供具有适当权限的 SQL 用户账户。如有需要,在 Databend 中创建一个,并确保 SQL 用户只有必要的权限以保证安全
5757

58-
本教程使用名为'user1'、密码为'abc123'的SQL用户作为示例。由于程序将向Databend写入数据,用户需要ALL权限。关于如何管理SQL用户及其权限,请参阅[用户与角色](/sql/sql-commands/ddl/user/)
58+
本教程使用名为'user1'、密码为'abc123'的 SQL 用户作为示例。由于程序将向 Databend 写入数据,用户需要 ALL 权限。关于如何管理 SQL 用户及其权限,请参阅[用户与角色](/sql/sql-commands/ddl/user/)
5959

6060
```sql
6161
CREATE USER user1 IDENTIFIED BY 'abc123';
6262
GRANT ALL on *.* TO user1;
6363
```
6464

65-
### 步骤2. 编写Golang程序
65+
### 步骤 2. 编写 Golang 程序
6666

67-
在本步骤中,您将创建一个简单的Golang程序,该程序与Databend通信。程序将涉及创建表、插入数据和执行数据查询等任务。
67+
在本步骤中,您将创建一个简单的 Golang 程序,该程序与 Databend 通信。程序将涉及创建表、插入数据和执行数据查询等任务。
6868

69-
<StepsWrap>
69+
<StepsWrap>
7070

7171
<StepContent number="1">
7272

73-
### 将以下代码复制并粘贴到文件main.go中
73+
### 将以下代码复制并粘贴到文件 main.go 中
7474

7575
:::note
76-
- 以下代码以连接到本地Databend、使用名为'user1'的SQL用户和密码'abc123'为例。您可以根据自己的值自由使用,同时保持相同格式。
77-
- 代码中`hostname`的值必须与Databend查询服务的HTTP处理程序设置一致。
78-
:::
76+
77+
- 以下代码以连接到本地 Databend、使用名为'user1'的 SQL 用户和密码'abc123'为例。您可以根据自己的值自由使用,同时保持相同格式。
78+
- 代码中`hostname`的值必须与 Databend 查询服务的 HTTP 处理程序设置一致。
79+
:::
7980

8081
```go title='main.go'
8182
package main
@@ -124,9 +125,9 @@ func main() {
124125
if err != nil {
125126
log.Fatal(err)
126127
}
127-
log.Println("创建数据库book_db成功")
128+
log.Println("创建数据库 book_db 成功")
128129

129-
// 使用book_db数据库
130+
// 使用 book_db 数据库
130131
_, err = db.Exec("USE book_db")
131132
if err != nil {
132133
log.Fatal(err)
@@ -140,12 +141,12 @@ func main() {
140141
}
141142
log.Println("创建表:books")
142143

143-
// 插入1行
144+
// 插入 1 行
144145
_, err = db.Exec("INSERT INTO books VALUES(?, ?, ?)", "mybook", "author", "2022")
145146
if err != nil {
146147
log.Fatal(err)
147148
}
148-
log.Println("插入1行")
149+
log.Println("插入 1 行")
149150

150151
// 选择。
151152
res, err := db.Query("SELECT * FROM books")
@@ -167,7 +168,6 @@ func main() {
167168
}
168169
```
169170

170-
171171
</StepContent>
172172

173173
<StepContent number="2">
@@ -199,45 +199,43 @@ require (
199199

200200
<StepContent number="3">
201201

202-
203-
### 运行程序。
202+
### 运行程序。
204203

205204
```shell
206205
go run main.go
207206
```
208207

209208
```text title='输出'
210209
2023/02/24 23:57:31 Connected
211-
2023/02/24 23:57:31 创建数据库book_db成功
210+
2023/02/24 23:57:31 创建数据库 book_db 成功
212211
2023/02/24 23:57:31 创建表:books
213-
2023/02/24 23:57:31 插入1行
212+
2023/02/24 23:57:31 插入 1 行
214213
2023/02/24 23:57:31 选择:{mybook author 2022}
215214
```
216215

217-
218216
</StepContent>
219217

220218
</StepsWrap>
221219

222-
## 教程-2:使用Golang与Databend Cloud集成
220+
## 教程 -2:使用 Golang 与 Databend Cloud 集成
223221

224222
开始之前,请确保您已成功创建仓库并获取连接信息。关于如何操作,请参阅[连接到仓库](/guides/cloud/using-databend-cloud/warehouses#connecting)
225223

226-
### 步骤1. 创建Go模块
224+
### 步骤 1. 创建 Go 模块
227225

228226
```shell
229227
$ mkdir sample
230228
$ cd sample
231229
$ go mod init cloud.databend.com/sample
232230
```
233231

234-
### 步骤2. 安装依赖
232+
### 步骤 2. 安装依赖
235233

236234
```go
237235
$ go get github.com/databendcloud/databend-go
238236
```
239237

240-
### 步骤3. 使用databend-go连接
238+
### 步骤 3. 使用 databend-go 连接
241239

242240
创建一个名为`main.go`的文件,其中包含以下代码:
243241

@@ -298,11 +296,11 @@ func main() {
298296
```
299297

300298
:::tip
301-
在代码中替换{USER}, {PASSWORD}, {HOST}, {WAREHOUSE_NAME}和{DATABASE}为您的连接信息。关于如何获取连接信息,请参阅[连接到仓库](/guides/cloud/using-databend-cloud/warehouses#connecting)
299+
在代码中替换`{USER}, {PASSWORD}, {HOST}, {WAREHOUSE_NAME}和{DATABASE}`为您的连接信息。关于如何获取连接信息,请参阅[连接到仓库](/guides/cloud/using-databend-cloud/warehouses#connecting)
302300
:::
303301

304-
### 步骤4. 运行main.go
302+
### 步骤 4. 运行 main.go
305303

306304
```shell
307305
$ go run main.go
308-
```
306+
```

0 commit comments

Comments
 (0)