From cd0d6bf3d97b71d73366d8501c963f3eff86dc31 Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 11:35:02 +0800 Subject: [PATCH 1/7] docs: add schemaless description zh --- docs/zh/08-connector/26-rust.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/zh/08-connector/26-rust.mdx b/docs/zh/08-connector/26-rust.mdx index 287d70bc44..3e0e365270 100644 --- a/docs/zh/08-connector/26-rust.mdx +++ b/docs/zh/08-connector/26-rust.mdx @@ -325,6 +325,8 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?; ### 无模式写入 +TDengine 支持无模式写入功能。无模式写入兼容 InfluxDB 的 行协议(Line Protocol)、OpenTSDB 的 telnet 行协议和 OpenTSDB 的 JSON 格式协议。详情请参见[无模式写入](../../reference/schemaless/)。 + ### 执行带有 req_id 的无模式写入 From 38ecf556b3395aab754bd25ae22d803acc35372f Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 11:35:08 +0800 Subject: [PATCH 2/7] docs: add schemaless description en --- docs/en/14-reference/03-connector/06-rust.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx index 402eba844c..5ce8192ccc 100644 --- a/docs/en/14-reference/03-connector/06-rust.mdx +++ b/docs/en/14-reference/03-connector/06-rust.mdx @@ -320,6 +320,8 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?; ### Schemaless Writing +TDengine supports schemaless writing. It is compatible with InfluxDB's Line Protocol, OpenTSDB's telnet line protocol, and OpenTSDB's JSON format protocol. For more information, see [Schemaless Writing](../../schemaless). + ### Schemaless with req_id From 5fa6632d4330e421867bd8361888ad7c9ef9ef6e Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 11:41:24 +0800 Subject: [PATCH 3/7] docs: add stmt description zh --- docs/zh/08-connector/26-rust.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/zh/08-connector/26-rust.mdx b/docs/zh/08-connector/26-rust.mdx index 3e0e365270..4e646a7c34 100644 --- a/docs/zh/08-connector/26-rust.mdx +++ b/docs/zh/08-connector/26-rust.mdx @@ -321,6 +321,8 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?; ### 通过参数绑定写入数据 +TDengine 的 Rust 连接器实现了参数绑定方式对数据写入(INSERT)场景的支持。采用这种方式写入数据时,能避免 SQL 语法解析的资源消耗,从而在很多情况下显著提升写入性能。 + ### 无模式写入 From 7aec0ab3a717f624bf13d4b009e8f74c2eb424ea Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 11:41:30 +0800 Subject: [PATCH 4/7] docs: add stmt description en --- docs/en/14-reference/03-connector/06-rust.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx index 5ce8192ccc..06d51028de 100644 --- a/docs/en/14-reference/03-connector/06-rust.mdx +++ b/docs/en/14-reference/03-connector/06-rust.mdx @@ -316,6 +316,8 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?; ### Writing data via parameter binding +TDengine has significantly improved the bind APIs to support data writing (INSERT) scenarios. Writing data in this way avoids the resource consumption of SQL syntax parsing, resulting in significant write performance improvements in many cases. + ### Schemaless Writing From 5e75202f93fe21996466e2a94d65e1efb3f16fca Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 11:44:39 +0800 Subject: [PATCH 5/7] docs: add create db description zh --- docs/zh/08-connector/26-rust.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/zh/08-connector/26-rust.mdx b/docs/zh/08-connector/26-rust.mdx index 4e646a7c34..c1b467510f 100644 --- a/docs/zh/08-connector/26-rust.mdx +++ b/docs/zh/08-connector/26-rust.mdx @@ -303,6 +303,8 @@ async fn main() -> anyhow::Result<()> { } ``` +> **注意**:如果不使用 `use db` 指定数据库,则后续对表的操作都需要增加数据库名称作为前缀,如 db.tb。 + ### 插入数据 From 35678e865c5e275308fb11134f1e9ede7fdcfe0b Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 11:44:51 +0800 Subject: [PATCH 6/7] docs: add create db description en --- docs/en/14-reference/03-connector/06-rust.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx index 06d51028de..4a7a184820 100644 --- a/docs/en/14-reference/03-connector/06-rust.mdx +++ b/docs/en/14-reference/03-connector/06-rust.mdx @@ -298,6 +298,8 @@ async fn main() -> anyhow::Result<()> { } ``` +> The query is consistent with operating a relational database. When using subscripts to get the contents of the returned fields, you have to start from 1. However, we recommend using the field names to get the values of the fields in the result set. + ### Insert data From b31b5f8e15b87665e51c053a933c5247c30a7f2f Mon Sep 17 00:00:00 2001 From: Adam Ji Date: Tue, 27 Jun 2023 14:00:14 +0800 Subject: [PATCH 7/7] docs: add param bind ref --- docs/en/14-reference/03-connector/06-rust.mdx | 8 +++++++- docs/zh/08-connector/26-rust.mdx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/en/14-reference/03-connector/06-rust.mdx b/docs/en/14-reference/03-connector/06-rust.mdx index 4a7a184820..986b5cd104 100644 --- a/docs/en/14-reference/03-connector/06-rust.mdx +++ b/docs/en/14-reference/03-connector/06-rust.mdx @@ -320,6 +320,8 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?; TDengine has significantly improved the bind APIs to support data writing (INSERT) scenarios. Writing data in this way avoids the resource consumption of SQL syntax parsing, resulting in significant write performance improvements in many cases. +Parameter binding details see [API Reference](#stmt-api) + ### Schemaless Writing @@ -573,9 +575,13 @@ Note that Rust asynchronous functions and an asynchronous runtime are required. - `.create_database(database: &str)`: Executes the `CREATE DATABASE` statement. - `.use_database(database: &str)`: Executes the `USE` statement. -In addition, this structure is also the entry point for [Parameter Binding](#Parameter Binding Interface) and [Line Protocol Interface](#Line Protocol Interface). Please refer to the specific API descriptions for usage. +In addition, this structure is also the entry point for Parameter Binding and Line Protocol Interface. Please refer to the specific API descriptions for usage. +

+ Bind Interface + +

Similar to the C interface, Rust provides the bind interface's wrapping. First, the [Taos][struct.taos] object creates a parameter binding object [Stmt] for an SQL statement. diff --git a/docs/zh/08-connector/26-rust.mdx b/docs/zh/08-connector/26-rust.mdx index c1b467510f..79a6badfea 100644 --- a/docs/zh/08-connector/26-rust.mdx +++ b/docs/zh/08-connector/26-rust.mdx @@ -325,6 +325,8 @@ let rs = taos.query_with_req_id("select * from stable where tag1 is null", 1)?; TDengine 的 Rust 连接器实现了参数绑定方式对数据写入(INSERT)场景的支持。采用这种方式写入数据时,能避免 SQL 语法解析的资源消耗,从而在很多情况下显著提升写入性能。 +参数绑定接口详见[API参考](#stmt-api) + ### 无模式写入 @@ -576,9 +578,13 @@ let taos = pool.get()?; - `.create_database(database: &str)`: 执行 `CREATE DATABASE` 语句。 - `.use_database(database: &str)`: 执行 `USE` 语句。 -除此之外,该结构也是 [参数绑定](#参数绑定接口) 和 [行协议接口](#行协议接口) 的入口,使用方法请参考具体的 API 说明。 +除此之外,该结构也是参数绑定和行协议接口的入口,使用方法请参考具体的 API 说明。 +

+ 参数绑定接口 + +

与 C 接口类似,Rust 提供参数绑定接口。首先,通过 [Taos][struct.Taos] 对象创建一个 SQL 语句的参数绑定对象 [Stmt]: