未验证 提交 d64a38a2 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #12474 from taosdata/docs/dingbo/format-connect

docs: format connect page
```csharp title="原生连接" ```csharp title="原生连接"
{{#include docs-examples/csharp/ConnectExample.cs}} {{#include docs-examples/csharp/ConnectExample.cs}}
``` ```
:::info :::info
C# 连接器目前只支持原生连接。 C# 连接器目前只支持原生连接。
::: :::
\ No newline at end of file
#### 使用数据库访问统一接口 #### 使用数据库访问统一接口
```go title="原生连接" ```go title="原生连接"
{{#include docs-examples/go/connect/cgoexample/main.go}} {{#include docs-examples/go/connect/cgoexample/main.go}}
``` ```
```go title="REST 连接" ```go title="REST 连接"
{{#include docs-examples/go/connect/restexample/main.go}} {{#include docs-examples/go/connect/restexample/main.go}}
``` ```
#### 使用高级封装 #### 使用高级封装
也可以使用 driver-go 的 af 包建立连接。这个模块封装了 TDengine 的高级功能, 如:参数绑定、订阅等。 也可以使用 driver-go 的 af 包建立连接。这个模块封装了 TDengine 的高级功能, 如:参数绑定、订阅等。
```go title="使用 af 包建立原生连接" ```go title="使用 af 包建立原生连接"
{{#include docs-examples/go/connect/afconn/main.go}} {{#include docs-examples/go/connect/afconn/main.go}}
``` ```
```java title="原生连接" ```java title="原生连接"
{{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} {{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}}
``` ```
```java title="REST 连接" ```java title="REST 连接"
{{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} {{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}}
``` ```
使用REST 连接时,如果查询数据量比较大,还可开启批量拉取功能。
使用 REST 连接时,如果查询数据量比较大,还可开启批量拉取功能。
```java title="开启批量拉取功能" {4} ```java title="开启批量拉取功能" {4}
{{#include docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} {{#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)
```js title="原生连接" ```js title="原生连接"
{{#include docs-examples/node/nativeexample/connect.js}} {{#include docs-examples/node/nativeexample/connect.js}}
``` ```
```js title="REST 连接" ```js title="REST 连接"
{{#include docs-examples/node/restexample/connect.js}} {{#include docs-examples/node/restexample/connect.js}}
``` ```
\ No newline at end of file
```python title="原生连接" ```python title="原生连接"
{{#include docs-examples/python/connect_exmaple.py}} {{#include docs-examples/python/connect_exmaple.py}}
``` ```
\ No newline at end of file
```r title="原生连接" ```r title="原生连接"
{{#include docs-examples/R/connect_native.r:demo}} {{#include docs-examples/R/connect_native.r:demo}}
``` ```
\ No newline at end of file
```rust title="原生连接/REST 连接" ```rust title="原生连接/REST 连接"
{{#include docs-examples/rust/nativeexample/examples/connect.rs}} {{#include docs-examples/rust/nativeexample/examples/connect.rs}}
``` ```
:::note :::note
对于 Rust 连接器, 连接方式的不同只体现在使用的特性不同。如果启用了 "rest" 特性,那么只有 RESTful 的实现会被编译进来。 对于 Rust 连接器, 连接方式的不同只体现在使用的特性不同。如果启用了 "rest" 特性,那么只有 RESTful 的实现会被编译进来。
......
```csharp title="Native Connection" ```csharp title="Native Connection"
{{#include docs-examples/csharp/ConnectExample.cs}} {{#include docs-examples/csharp/ConnectExample.cs}}
``` ```
:::info :::info
C# connector supports only native connection for now. C# connector supports only native connection for now.
::: :::
\ No newline at end of file
#### Unified Database Access Interface #### Unified Database Access Interface
```go title="Native Connection" ```go title="Native Connection"
{{#include docs-examples/go/connect/cgoexample/main.go}} {{#include docs-examples/go/connect/cgoexample/main.go}}
``` ```
```go title="REST Connection" ```go title="REST Connection"
{{#include docs-examples/go/connect/restexample/main.go}} {{#include docs-examples/go/connect/restexample/main.go}}
``` ```
#### Advanced Features #### 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. 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" ```go title="Establish native connection using af package"
{{#include docs-examples/go/connect/afconn/main.go}} {{#include docs-examples/go/connect/afconn/main.go}}
``` ```
```java title="Native Connection" ```java title="Native Connection"
{{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} {{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}}
``` ```
```java title="REST Connection" ```java title="REST Connection"
{{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} {{#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. 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} ```java title="Enable Bulk Pulling" {4}
{{#include docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} {{#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)
```js title="Native Connection" ```js title="Native Connection"
{{#include docs-examples/node/nativeexample/connect.js}} {{#include docs-examples/node/nativeexample/connect.js}}
``` ```
```js title="REST Connection" ```js title="REST Connection"
{{#include docs-examples/node/restexample/connect.js}} {{#include docs-examples/node/restexample/connect.js}}
``` ```
\ No newline at end of file
```python title="Native Connection" ```python title="Native Connection"
{{#include docs-examples/python/connect_exmaple.py}} {{#include docs-examples/python/connect_exmaple.py}}
``` ```
\ No newline at end of file
```r title="Native Connection" ```r title="Native Connection"
{{#include docs-examples/R/connect_native.r:demo}} {{#include docs-examples/R/connect_native.r:demo}}
``` ```
\ No newline at end of file
```rust title="Native Connection/REST Connection" ```rust title="Native Connection/REST Connection"
{{#include docs-examples/rust/nativeexample/examples/connect.rs}} {{#include docs-examples/rust/nativeexample/examples/connect.rs}}
``` ```
:::note :::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. 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册