[]
        
(Showing Draft Content)

Connect to TDengine

TDengine is a time series database used to read and write data at high speed in real-time. In this section, you will find information on the following topics:

To Create a TDengine

To create a TDengine in Wyn Enterprise, navigate to the Resource Portal and follow the below instructions.

  1. Click the + icon and then, select the Create Data Source option.

    Create TDengine Datasource

  2. Select the TDengine option from the data source list on the left or from the icon view under the RDBMS section on the right.

    Select DTengine Datasource

  3. Fill in the database configuration information. The database configuration items are described in the table below. Click the Test Connection button to verify the data source connection. Once the connection is tested and validated, you will receive a notification of a successful connection. Click the Create button to finish.

    Connection configuration of TDengine

    Field

    Description

    Name*

    The name of the data source that you want to specify.

    Host*

    A hostname or address.

    Port*

    A port number, the default is 6030.

    UserName*

    A user name to connect to the database.

    Password*

    A password of the user.

    Database

    Enter the database name or click the drop-down to select any.

    Use Configuration String (Advanced)

    Use this option to connect to the data provider through a connection string. The format of the connection string is:

    Host=myHost;Port=myPort;Username=myUsername;Password=myPassword;Database=myDatabase

    * Required fields

  4. You can view the newly added data source in the Categories tab and Data Source Document Type tab of the Resource Portal.

Salient Points

  1. Currently Wyn supports only TDengine 2. x version.

  2. TDengine datasource is only supported in the Native Query Dataset.

  • It does not support Direct Model.

  • The connector does not support GetSchema method.

  1. The following table lists the TDengine data type as compared to the C# data types.

    TDengine Datatype

    C# Datatype

    Dataset Datatype

    TIMESTAMP

    DateTime

    DateTime

    INT

    int

    Number

    BIGINT

    long

    Number

    FLOAT

    float

    Number

    DOUBLE

    double

    Number

    BINARY

    byte[]

    String

    TINYINT

    sbyte

    Number

    BOOL

    bool

    Boolean

    NCHAR

    string

    String

    JSON

    string

    String

    For more details on data types, refer to this article.

  2. Connection configurations for TDengine: "myHost;Port=myPort;Username=myUsername;Password=myPassword;Database=myDatabase;Charset=UTF-8;Timezone=UTC-8;"

    Options supported in the connection string are listed and described in the following table,

    Property Name

    Mandatory

    Description

    Host

    Yes

    Host to be connected

    Port

    Yes

    Port to be connected

    Username

    Yes

    Username

    Password

    Yes

    Password

    Database

    No

    Database to be connected

    Charset

    No

    Charset set in the system

    Timezone

    No

    TimeZone configured in the host

    Note: Timezone does not support setting decimals using UTC and GMT methods. It supports UTF-8, UTF--8.

  3. If you need more configuration items, then you can modify the {WynInstallationDirectory}/Plugins/Dataset/TDengineDriver/taos.cfg file, where rpcForceTcp=1 is the default setting, which is more stable using TCP connections. See this help article for more information.

TDengine Connections

The GetSchema() method will return an empty table with the correct structure. The TDengine data source does not support the Preview and Table/Column mapping.

  • When you preview a TDengine data source, the preview will show Can not get the data source schema because the Schema information is not available. The behavior is consistent with InfluxDB, ElasticSearchDSL data sources.

  • The Use Table/Field Name Mapping option is not displayed on the Create Data Source page.

TDengineCommand Parameters

Since the Connector is using stmt to bind the parameters, the defined parameters need to be replaced in the query statement.


Parameter substitution rules are defined below in the table.

Parameter Type

Parameter Value

Replacement Value

Multi-value Parameter Values

Multi-value Replacement Values

Integer

-15

0

160

-15

0

160

-20,0,15

-20,0,15

Float

-15.2

0.1

9.6

-15.2

0.1

9.6

-15.2,0.1,9.6

-15.2,0.1,9.6

Guid

00000000-0000-0000-0000-

000000000000

a3b324e2-7549-432a-a4e7-dc2faddaceaa

'00000000-0000-0000-0000-

000000000000'

'a3b324e2-7549-432a-a4e7-dc2faddaceaa'

00000000-0000-0000-0000-000000000000,a3b324e2-7549-432a-a4e7-dc2faddaceaa

'00000000-0000-0000-0000-000000000000','a3b324e2-7549-432a-a4e7-dc2faddaceaa'

DateTime

2023-02-22 14:48:07

'2023-02-22 14:48:07'

2023-02-22 14:48:07,2023-02-22 14:48:08

'2023-02-22 14:48:07','2023-02-22 14:48:08'

Date

2023-02-22

'2023-02-22'

2023-02-22,2023-02-23

'2023-02-22','2023-02-23'

Boolean

True

False

true

false

true,false

true,false

String

hello

'hello'

hello,tdengine

'hello','tdengine'

Listed below is the format of parameters in the query statement:

  • The parameter must be prefixed with "@".

  • The parameter must start with a letter or an underscore.

  • The parameter can only contain letters, numbers, and underscores.

  • If the query statement needs to use the "@" symbol to express a non-parameter statement, then you need to add "" before the "@" symbol.

    Note: CommandTimeout is not supported.

TDengine Limitations

Listed below are the limitations of TDengine.

  1. Since the. NET connector interface requires the taos.dll file, so before executing the application, you need to copy the taos.dll file in the Windows {client_install_directory}/driver directory to the folder where the .NET project finally generated the .exe executable file. After running the exe file, you can access the TDengine database and do operations such as insert and query(This step can be skipped if the client has been installed on your machine).

  2. TDengine datasource provides the driver version 2.6.0.34, when your TDengine version is different, you need to replace the driver file manually.

  3. TDengine uses FQDN (usually hostname)as the ID for a node. To make the system work, you need to configure the FQDN for the server running taosd, and configure the DNS service or hosts file on the machine where the application or TDengine CLI runs to ensure that the FQDN can be resolved. Refer to this article for more details.

  4. The C# connector supports: Linux 64/Windows x64/Windows x86. Refer to this article for C# connector support.