From 51464d88b6dbfb1f6b541f6d1f680247616b84eb Mon Sep 17 00:00:00 2001 From: dingbo Date: Sat, 14 May 2022 17:34:44 +0800 Subject: [PATCH] docs: format connect page --- docs-cn/04-develop/01-connect/_connect_cs.mdx | 3 ++- docs-cn/04-develop/01-connect/_connect_go.mdx | 6 ++++-- docs-cn/04-develop/01-connect/_connect_java.mdx | 8 ++++++-- docs-cn/04-develop/01-connect/_connect_node.mdx | 3 ++- docs-cn/04-develop/01-connect/_connect_python.mdx | 2 +- docs-cn/04-develop/01-connect/_connect_r.mdx | 2 +- docs-cn/04-develop/01-connect/_connect_rust.mdx | 1 + docs-en/04-develop/01-connect/_connect_cs.mdx | 3 ++- docs-en/04-develop/01-connect/_connect_go.mdx | 6 ++++-- docs-en/04-develop/01-connect/_connect_java.mdx | 5 ++++- docs-en/04-develop/01-connect/_connect_node.mdx | 3 ++- docs-en/04-develop/01-connect/_connect_python.mdx | 2 +- docs-en/04-develop/01-connect/_connect_r.mdx | 2 +- docs-en/04-develop/01-connect/_connect_rust.mdx | 1 + 14 files changed, 32 insertions(+), 15 deletions(-) diff --git a/docs-cn/04-develop/01-connect/_connect_cs.mdx b/docs-cn/04-develop/01-connect/_connect_cs.mdx index 204173dd32..821820e8fe 100644 --- a/docs-cn/04-develop/01-connect/_connect_cs.mdx +++ b/docs-cn/04-develop/01-connect/_connect_cs.mdx @@ -1,7 +1,8 @@ ```csharp title="原生连接" {{#include docs-examples/csharp/ConnectExample.cs}} ``` + :::info C# 连接器目前只支持原生连接。 -::: \ No newline at end of file +::: diff --git a/docs-cn/04-develop/01-connect/_connect_go.mdx b/docs-cn/04-develop/01-connect/_connect_go.mdx index 4e4f189672..478768caaa 100644 --- a/docs-cn/04-develop/01-connect/_connect_go.mdx +++ b/docs-cn/04-develop/01-connect/_connect_go.mdx @@ -1,15 +1,17 @@ #### 使用数据库访问统一接口 + ```go title="原生连接" {{#include docs-examples/go/connect/cgoexample/main.go}} ``` + ```go title="REST 连接" {{#include docs-examples/go/connect/restexample/main.go}} ``` + #### 使用高级封装 + 也可以使用 driver-go 的 af 包建立连接。这个模块封装了 TDengine 的高级功能, 如:参数绑定、订阅等。 ```go title="使用 af 包建立原生连接" {{#include docs-examples/go/connect/afconn/main.go}} ``` - - diff --git a/docs-cn/04-develop/01-connect/_connect_java.mdx b/docs-cn/04-develop/01-connect/_connect_java.mdx index cd6d7c4cab..635f39ceb2 100644 --- a/docs-cn/04-develop/01-connect/_connect_java.mdx +++ b/docs-cn/04-develop/01-connect/_connect_java.mdx @@ -1,11 +1,15 @@ ```java title="原生连接" {{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} ``` + ```java title="REST 连接" {{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} ``` -使用REST 连接时,如果查询数据量比较大,还可开启批量拉取功能。 + +使用 REST 连接时,如果查询数据量比较大,还可开启批量拉取功能。 + ```java title="开启批量拉取功能" {4} {{#include docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} ``` -更多连接参数配置,参考[Java 连接器](/reference/connector/java) \ No newline at end of file + +更多连接参数配置,参考[Java 连接器](/reference/connector/java) diff --git a/docs-cn/04-develop/01-connect/_connect_node.mdx b/docs-cn/04-develop/01-connect/_connect_node.mdx index 8a259888f8..199a6e3faa 100644 --- a/docs-cn/04-develop/01-connect/_connect_node.mdx +++ b/docs-cn/04-develop/01-connect/_connect_node.mdx @@ -1,6 +1,7 @@ ```js title="原生连接" {{#include docs-examples/node/nativeexample/connect.js}} ``` + ```js title="REST 连接" {{#include docs-examples/node/restexample/connect.js}} -``` \ No newline at end of file +``` diff --git a/docs-cn/04-develop/01-connect/_connect_python.mdx b/docs-cn/04-develop/01-connect/_connect_python.mdx index 331ec0f693..43e13ab56e 100644 --- a/docs-cn/04-develop/01-connect/_connect_python.mdx +++ b/docs-cn/04-develop/01-connect/_connect_python.mdx @@ -1,3 +1,3 @@ ```python title="原生连接" {{#include docs-examples/python/connect_exmaple.py}} -``` \ No newline at end of file +``` diff --git a/docs-cn/04-develop/01-connect/_connect_r.mdx b/docs-cn/04-develop/01-connect/_connect_r.mdx index a69a57f66b..8aab6121a6 100644 --- a/docs-cn/04-develop/01-connect/_connect_r.mdx +++ b/docs-cn/04-develop/01-connect/_connect_r.mdx @@ -1,3 +1,3 @@ ```r title="原生连接" {{#include docs-examples/R/connect_native.r:demo}} -``` \ No newline at end of file +``` diff --git a/docs-cn/04-develop/01-connect/_connect_rust.mdx b/docs-cn/04-develop/01-connect/_connect_rust.mdx index b051108452..9e64724c17 100644 --- a/docs-cn/04-develop/01-connect/_connect_rust.mdx +++ b/docs-cn/04-develop/01-connect/_connect_rust.mdx @@ -1,6 +1,7 @@ ```rust title="原生连接/REST 连接" {{#include docs-examples/rust/nativeexample/examples/connect.rs}} ``` + :::note 对于 Rust 连接器, 连接方式的不同只体现在使用的特性不同。如果启用了 "rest" 特性,那么只有 RESTful 的实现会被编译进来。 diff --git a/docs-en/04-develop/01-connect/_connect_cs.mdx b/docs-en/04-develop/01-connect/_connect_cs.mdx index 43fb50cac9..52ea2d4371 100644 --- a/docs-en/04-develop/01-connect/_connect_cs.mdx +++ b/docs-en/04-develop/01-connect/_connect_cs.mdx @@ -1,7 +1,8 @@ ```csharp title="Native Connection" {{#include docs-examples/csharp/ConnectExample.cs}} ``` + :::info C# connector supports only native connection for now. -::: \ No newline at end of file +::: diff --git a/docs-en/04-develop/01-connect/_connect_go.mdx b/docs-en/04-develop/01-connect/_connect_go.mdx index 314e683147..1dd5d67e35 100644 --- a/docs-en/04-develop/01-connect/_connect_go.mdx +++ b/docs-en/04-develop/01-connect/_connect_go.mdx @@ -1,15 +1,17 @@ #### Unified Database Access Interface + ```go title="Native Connection" {{#include docs-examples/go/connect/cgoexample/main.go}} ``` + ```go title="REST Connection" {{#include docs-examples/go/connect/restexample/main.go}} ``` + #### Advanced Features + The af package of driver-go can also be used to establish connection, with this way some advanced features of TDengine, like parameter binding and subscription, can be used. ```go title="Establish native connection using af package" {{#include docs-examples/go/connect/afconn/main.go}} ``` - - diff --git a/docs-en/04-develop/01-connect/_connect_java.mdx b/docs-en/04-develop/01-connect/_connect_java.mdx index f0544ed6f4..1c3e9326bf 100644 --- a/docs-en/04-develop/01-connect/_connect_java.mdx +++ b/docs-en/04-develop/01-connect/_connect_java.mdx @@ -1,12 +1,15 @@ ```java title="Native Connection" {{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} ``` + ```java title="REST Connection" {{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} ``` + When using REST connection, the feature of bulk pulling can be enabled if the size of resulting data set is huge. ```java title="Enable Bulk Pulling" {4} {{#include docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} ``` -More configuration about connection,please refer to [Java Connector](/reference/connector/java) \ No newline at end of file + +More configuration about connection,please refer to [Java Connector](/reference/connector/java) diff --git a/docs-en/04-develop/01-connect/_connect_node.mdx b/docs-en/04-develop/01-connect/_connect_node.mdx index 9c0e5b0be1..489b0386e9 100644 --- a/docs-en/04-develop/01-connect/_connect_node.mdx +++ b/docs-en/04-develop/01-connect/_connect_node.mdx @@ -1,6 +1,7 @@ ```js title="Native Connection" {{#include docs-examples/node/nativeexample/connect.js}} ``` + ```js title="REST Connection" {{#include docs-examples/node/restexample/connect.js}} -``` \ No newline at end of file +``` diff --git a/docs-en/04-develop/01-connect/_connect_python.mdx b/docs-en/04-develop/01-connect/_connect_python.mdx index 0235405772..f6c8bcfee1 100644 --- a/docs-en/04-develop/01-connect/_connect_python.mdx +++ b/docs-en/04-develop/01-connect/_connect_python.mdx @@ -1,3 +1,3 @@ ```python title="Native Connection" {{#include docs-examples/python/connect_exmaple.py}} -``` \ No newline at end of file +``` diff --git a/docs-en/04-develop/01-connect/_connect_r.mdx b/docs-en/04-develop/01-connect/_connect_r.mdx index 0f6e6cc18e..09c3d71ac3 100644 --- a/docs-en/04-develop/01-connect/_connect_r.mdx +++ b/docs-en/04-develop/01-connect/_connect_r.mdx @@ -1,3 +1,3 @@ ```r title="Native Connection" {{#include docs-examples/R/connect_native.r:demo}} -``` \ No newline at end of file +``` diff --git a/docs-en/04-develop/01-connect/_connect_rust.mdx b/docs-en/04-develop/01-connect/_connect_rust.mdx index 0165114d2a..aa19f58de6 100644 --- a/docs-en/04-develop/01-connect/_connect_rust.mdx +++ b/docs-en/04-develop/01-connect/_connect_rust.mdx @@ -1,6 +1,7 @@ ```rust title="Native Connection/REST Connection" {{#include docs-examples/rust/nativeexample/examples/connect.rs}} ``` + :::note For Rust connector, the connection depends on the feature being used. If "rest" feature is enabled, then only the implementation for "rest" is compiled and packaged. -- GitLab