Merge branch '3.0' into enh/TS-5297-3.0

This commit is contained in:
kailixu 2024-08-29 17:47:53 +08:00
commit f3e553e1be
505 changed files with 110927 additions and 5445 deletions

View File

@ -656,6 +656,7 @@ use_current_timezone: {
For example, if the time zone configured by the Client is UTC + 0800, TIMETRUNCATE ('2020-01-01 23:00:00', 1d, 0) returns the result of '2020-01-01 08:00:00'.
When using TIMETRUNCATE ('2020-01-01 23:00:00', 1d, 1), the result is 2020-01-01 00:00:00 '.
When use_current_timezone is not specified, use_current_timezone defaults to 1.
- When truncating a time value to the week (1w), weeks are determined using the Unix epoch (1970-01-01T00:00:00Z UTC). The Unix epoch was on a Thursday, so all calculated weeks begin on Thursday.
#### TIMEZONE

View File

@ -64,64 +64,20 @@ In the above example code, `taos_connect()` establishes a connection to port 603
## Sample program
This section shows sample code for standard access methods to TDengine clusters using the client driver.
This section shows sample code for standard access methods to TDengine clusters using the client driver.
### Synchronous query example
- [Synchronous query example](https://github.com/taosdata/TDengine/tree/main/docs/examples/c/demo.c)
<details>
<summary>Synchronous query</summary>
- [Asynchronous query example](https://github.com/taosdata/TDengine/tree/main/docs/examples/c/asyncdemo.c)
```c
{{#include examples/c/demo.c}}
```
- [Parameter binding example](https://github.com/taosdata/TDengine/tree/main/docs/examples/c/prepare.c)
</details>
- [Schemaless writing example](https://github.com/taosdata/TDengine/tree/main/docs/examples/c/schemaless.c)
### Asynchronous query example
<details>
<summary>Asynchronous queries</summary>
```c
{{#include examples/c/asyncdemo.c}}
```
</details>
### Parameter binding example
<details>
<summary>Parameter Binding</summary>
```c
{{#include examples/c/prepare.c}}
```
</details>
### Pattern-free writing example
<details>
<summary>Mode free write</summary>
```c
{{#include examples/c/schemaless.c}}
```
</details>
### Subscription and consumption example
<details>
<summary>Subscribe and consume</summary>
```c
```
</details>
- [Subscription and consumption example](https://github.com/taosdata/TDengine/tree/main/docs/examples/c/tmq.c)
:::info
More example code and downloads are available at [GitHub](https://github.com/taosdata/TDengine/tree/develop/examples/c).
More example code and downloads are available at [GitHub](https://github.com/taosdata/TDengine/tree/main/docs/examples/c).
You can find it in the installation directory under the `examples/c` path. This directory has a makefile and can be compiled under Linux/macOS by executing `make` directly.
**Hint:** When compiling in an ARM environment, please remove `-msse4.2` from the makefile. This option is only supported on the x64/x86 hardware platforms.
@ -311,7 +267,7 @@ Starting with versions 2.1.1.0 and 2.1.2.0, TDengine has significantly improved
Note: If `taos_stmt_execute()` succeeds, you can reuse the parsed result of `taos_stmt_prepare()` to bind new data in steps 3 to 6 if you don't need to change the SQL command. However, if there is an execution error, it is not recommended to continue working in the current context but release the resources and start again with `taos_stmt_init()` steps.
The specific functions related to the interface are as follows (see also the [prepare.c](https://github.com/taosdata/TDengine/blob/develop/examples/c/prepare.c) file for the way to use the corresponding functions)
The specific functions related to the interface are as follows (see also the [prepare.c](https://github.com/taosdata/TDengine/blob/develop/docs/examples/c/prepare.c) file for the way to use the corresponding functions)
- `TAOS_STMT* taos_stmt_init(TAOS *taos)`
@ -661,4 +617,4 @@ In addition to writing data using the SQL method or the parameter binding API, w
- tmq_get_table_name : table name of result, NULL if failed
- tmq_get_res_type : result type tmq_res_t
- tmq_get_topic_name : topic name of result, NULL if failed
- tmq_get_db_name : db name of result, NULL if failed
- tmq_get_db_name : db name of result, NULL if failed

View File

@ -150,7 +150,7 @@ TDengine currently supports timestamp, number, character, Boolean type, and the
Due to historical reasons, the BINARY type data in TDengine is not truly binary data and is no longer recommended for use. Please use VARBINARY type instead.
GEOMETRY type is binary data in little endian byte order, which complies with the WKB specification. For detailed information, please refer to [Data Type](../../taos-sql/data-type/)
For WKB specifications, please refer to [Well Known Binary (WKB)](https://libgeos.org/specifications/wkb/)
For Java connector, the jts library can be used to easily create GEOMETRY type objects, serialize them, and write them to TDengine. Here is an example [Geometry example](https://github.com/taosdata/TDengine/blob/3.0/docs/examples/java/src/main/java/com/taos/example/GeometryDemo.java)
For Java connector, the jts library can be used to easily create GEOMETRY type objects, serialize them, and write them to TDengine. Here is an example [Geometry example](https://github.com/taosdata/TDengine/blob/main/docs/examples/java/src/main/java/com/taos/example/GeometryDemo.java)
## Installation Steps
@ -662,7 +662,7 @@ Example usage is as follows.
### More sample programs
The source code of the sample application is under `TDengine/examples/JDBC`:
The source code of the sample application is under `TDengine/docs/examples/JDBC`:
- JDBCDemo: JDBC sample source code.
- connectionPools: using taos-jdbcdriver in connection pools such as HikariCP, Druid, dbcp, c3p0, etc.
@ -671,7 +671,7 @@ The source code of the sample application is under `TDengine/examples/JDBC`:
- springbootdemo: using taos-jdbcdriver in Springboot.
- consumer-demo: consumer TDengine data example, the consumption rate can be controlled by parameters.
[JDBC example](https://github.com/taosdata/TDengine/tree/3.0/examples/JDBC)
[JDBC example](https://github.com/taosdata/TDengine/tree/main/docs/examples/JDBC)
## Frequently Asked Questions

View File

@ -368,7 +368,7 @@ The TDengine Go client library supports subscription functionality with the foll
### More sample programs
* [sample program](https://github.com/taosdata/driver-go/tree/3.0/examples)
* [sample program](https://github.com/taosdata/driver-go/tree/main/examples)
## Frequently Asked Questions

View File

@ -403,7 +403,7 @@ The following parameters can be configured for the TMQ DSN. Only `group.id` is m
#### Full Sample Code
For more information, see [GitHub sample file](https://github.com/taosdata/TDengine/blob/3.0/docs/examples/rust/nativeexample/examples/subscribe_demo.rs).
For more information, see [GitHub sample file](https://github.com/taosdata/TDengine/blob/main/docs/examples/rust/nativeexample/examples/subscribe_demo.rs).
### Use with connection pool
@ -437,9 +437,9 @@ let taos = pool.get()?;
### More sample programs
The source code of the sample application is under `TDengine/examples/rust` :
The source code of the sample application is under `TDengine/docs/examples/rust` :
[rust example](https://github.com/taosdata/TDengine/tree/3.0/examples/rust)
[rust example](https://github.com/taosdata/TDengine/tree/main/docs/examples/rust)
## Frequently Asked Questions

Some files were not shown because too many files have changed in this diff Show More