提交 9c4343b1 编写于 作者: D dingbo

test: add async query example for C to CI

上级 41355a99
......@@ -172,7 +172,7 @@ Query OK, 5 row(s) in set (0.001521s)
<TabItem label="C#" value="csharp">
<CsAsync />
</TabItem>
{/* <TabItem label="C" value="c">
<TabItem label="C" value="c">
<CAsync />
</TabItem> */}
</TabItem>
</Tabs>
......@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <taos.h>
typedef int16_t VarDataLenT;
......@@ -132,6 +133,7 @@ void *fetch_row_callback(void *param, TAOS_RES *res, int numOfRow) {
}
taos_fetch_rows_a(res, fetch_row_callback, _taos);
} else {
printf("no more data, close the connection.\n");
taos_free_result(res);
taos_close(_taos);
taos_cleanup();
......@@ -173,7 +175,7 @@ int main() {
// param four can be any pointer. It will be passed to your callback function as the first parameter. we use taos
// here, because we want to close it after getting data.
taos_query_a(taos, "SELECT * FROM meters", select_callback, taos);
getchar();
sleep(1);
}
// output:
......@@ -189,4 +191,5 @@ int main() {
// 1538548685000 10.800000 223 0.290000 beijing.haidian 3
// 1538548686500 11.500000 221 0.350000 beijing.haidian 3
// numOfRow = 0
// no more data, close the connection.
// ANCHOR_END: demo
\ No newline at end of file
......@@ -11,6 +11,9 @@ cd ../../docs-examples/c
gcc connect_example.c -o connect_example -ltaos
./connect_example
gcc -o async_query_example async_query_example.c -ltaos
./async_query_example
# 2
taos -s "drop database if exists power"
gcc -o insert_example insert_example.c -ltaos
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册