Connector
TDengine provides a rich set of APIs (application development interface). To facilitate users to develop their applications quickly, TDengine supports connectors for multiple programming languages, including official connectors for C/C++, Java, Python, Go, Node.js, C#, and Rust. These connectors support connecting to TDengine clusters using both native interfaces (taosc) and REST interfaces (not supported in a few languages yet). Community developers have also contributed several unofficial connectors, such as the ADO.NET connector, the Lua connector, and the PHP connector.
Supported platforms
Currently, TDengine’s native interface connectors can support platforms such as X64/X86/ARM64/ARM32/MIPS/Alpha hardware platforms and Linux/Win64/Win32 development environments. The comparison matrix is as follows.
CPU | OS | JDBC | Python | Go | Node.js | C# | Rust | C/C++ |
---|---|---|---|---|---|---|---|---|
X86 64bit | Linux | ● | ● | ● | ● | ● | ● | ● |
X86 64bit | Win64 | ● | ● | ● | ● | ● | ● | ● |
X86 64bit | Win32 | ● | ● | ● | ● | ○ | ○ | ● |
X86 32bit | Win32 | ○ | ○ | ○ | ○ | ○ | ○ | ● |
ARM64 | Linux | ● | ● | ● | ● | ○ | ○ | ● |
ARM32 | Linux | ● | ● | ● | ● | ○ | ○ | ● |
MIPS | Linux | ○ | ○ | ○ | ○ | ○ | ○ | ○ |
Where ● means the official test verification passed, ○ means the unofficial test verification passed, — means no assurance.
Using REST connection can support a broader range of operating systems as it does not rely on client drivers.
Version support
TDengine version updates often add new features, and the connector versions in the list are the best-fit versions of the connector.
TDengine Versions | Java | Python | Go | C# | Node.js | Rust |
---|---|---|---|---|---|---|
2.4.0.14 and up | 2.0.38 | current version | develop branch | 1.0.2 - 1.0.6 | 2.0.10 - 2.0.12 | current version |
2.4.0.6 and up | 2.0.37 | current version | develop branch | 1.0.2 - 1.0.6 | 2.0.10 - 2.0.12 | current version |
2.4.0.4 - 2.4.0.5 | 2.0.37 | current version | develop branch | 1.0.2 - 1.0.6 | 2.0.10 - 2.0.12 | current version |
2.2.x.x | 2.0.36 | current version | master branch | n/a | 2.0.7 - 2.0.9 | current version |
2.0.x.x | 2.0.34 | current version | master branch | n/a | 2.0.1 - 2.0.6 | current version |
Functional Features
Comparing the connector support for TDengine functional features as follows.
Using the native interface (taosc)
Functional Features | Java | Python | Go | C# | Node.js | Rust |
---|---|---|---|---|---|---|
Connection Management | Support | Support | Support | Support | Support | Support |
Regular Query | Support | Support | Support | Support | Support | Support |
Continuous Query | Support | Support | Support | Support | Support | Support |
Parameter Binding | Support | Support | Support | Support | Support | Support |
Subscription | Support | Support | Support | Support | Support | Not Supported |
Schemaless | Support | Support | Support | Support | Support | Support |
DataFrame | Not Supported | Support | Not Supported | Not Supported | Not Supported | Not Supported |
info
The different database framework specifications for various programming languages do not mean that all C/C++ interfaces need a wrapper.
Using the REST interface
Functional Features | Java | Python | Go | C# (not supported yet) | Node.js | Rust |
---|---|---|---|---|---|---|
Connection Management | Support | Support | Support | N/A | Support | Support |
Regular Query | Support | Support | Support | N/A | Support | Support |
Continous Query | Support | Support | Support | N/A | Support | Support |
Parameter Binding | Not Supported | Not Supported | Not Supported | N/A | Not Supported | Not Supported |
Subscription | Not Supported | Not Supported | Not Supported | N/A | Not Supported | Not Supported |
Schemaless | Not supported | Not Supported | Not Supported | N/A | Not Supported | Not supported |
Bulk Pulling (based on WebSocket) | Support | Not Supported | Not Supported | N/A | Not Supported | Not Supported |
DataFrame | Not supported | Support | Not supported | N/A | Not supported | Not supported |
warning
- Regardless of the programming language chosen for the connector, TDengine versions 2.0 and above recommend that each thread of a database application create a separate connection. Or create a connection pool based on threads to avoid interference between threads with the “USE statement” state within a connection (but the connection’s query and write operations are thread-safe).
Install Client Driver
info
The client driver needs to be installed if you use the native interface connector on a system that does not have the TDengine server software installed.
Installation steps
- Linux
- Windows
Download the TDengine client installation package
Enter your email to receive the download link
encn
Agree to TDengine to contact me via this email addressDownload
Close
Unzip
Download the package to any directory the current user has read/write permission. Then execute
tar -xzvf TDengine-client-VERSION.tar.gz
command. The VERSION should be the version of the package you just downloaded.Execute the install script
Once the package is unzipped, you will see the following files in the directory:
- install_client.sh: install script
- taos.tar.gz: client driver package
- driver: TDengine client driver
- examples: some example programs of different programming languages (C/C#/go/JDBC/MATLAB/python/R)
You can run
install_client.sh
to install it.Edit taos.cfg
Edit
taos.cfg
file (full path is/etc/taos/taos.cfg
by default), modifyfirstEP
with actual TDengine server’s End Point, for exampleh1.tdengine.com:6030
tip
If the computer does not run the TDengine service but installs the TDengine client driver, then you need to config
firstEP
intaos.cfg
only, and there is no need to configureFQDN
;If you encounter the “Unable to resolve FQDN” error, please make sure the FQDN in the
/etc/hosts
file of the current computer is correctly configured, or the DNS service is correctly configured.Download the client installation package
Enter your email to receive the download link
encn
Agree to TDengine to contact me via this email addressDownload
Close
Execute the installer, select the default value as prompted, and complete the installation
Installation path
The default installation path is C:\TDengine, including the following files (directories).
- taos.exe : TDengine CLI command-line program
- cfg : configuration file directory
- driver: client driver dynamic link library
- examples: sample programs bash/C/C#/go/JDBC/Python/Node.js
- include: header files
- log : log file
- unins000.exe: uninstaller
configure taos.cfg
Edit the taos.cfg file (default path C:\TDengine\cfg\taos.cfg) and change the firstEP to the End Point of the TDengine server, for example:
h1.tdengine.com:6030
.
tip
- If you use FQDN to connect to the server, you must ensure the local network environment DNS is configured, or add FQDN addressing records in the
hosts
file, e.g., edit C:\Windows\system32\drivers\etc\hosts and add a record like the following:192.168.1.99 h1.taosd.com
.. - Uninstall: Run unins000.exe to uninstall the TDengine client driver.
Installation Verification
After completing the above installation and configuration and you have confirmed that the TDengine service is up and running, you can execute the TDengine CLI tool to log in.
- Linux
- Windows
Execute TDengine CLI program taos
directly from the Linux shell to connect to the TDengine service and enter the TDengine CLI interface, as shown in the following example.
$ taos
Welcome to the TDengine shell from Linux, Client Version:2.0.5.0
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.
taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep1,keep2,keep(D) | cache(MB)| blocks | minrows | maxrows | wallevel | fsync | comp | precision | status |
=========================================================================================================================================================================================================================
test | 2020-10-14 10:35:48.617 | 10 | 1 | 1 | 1 | 2 | 3650,3650,3650 | 16| 6 | 100 | 4096 | 1 | 3000 | 2 | ms | ready |
log | 2020-10-12 09:08:21.651 | 4 | 1 | 1 | 1 | 10 | 30,30,30 | 1| 3 | 100 | 4096 | 1 | 3000 | 2 | us | ready |
Query OK, 2 row(s) in set (0.001198s)
taos>
Go to the C:\TDengine
directory from cmd
and execute TDengine CLI program taos.exe
directly to connect to the TDengine service and enter the TDengine CLI interface, for example, as follows:
C:\TDengine>taos
Welcome to the TDengine shell from Linux, Client Version:2.0.5.0
Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.
taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep1,keep2,keep(D) | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | precision | status |
===================================================================================================================================================================================================================================================================
test | 2020-10-14 10:35:48.617 | 10 | 1 | 1 | 1 | 2 | 3650,3650,3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | ms | ready |
log | 2020-10-12 09:08:21.651 | 4 | 1 | 1 | 1 | 10 | 30,30,30 | 1 | 3 | 100 | 4096 | 1 | 3000 | 2 | us | ready |
Query OK, 2 row(s) in set (0.045000s)
taos>