Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e9bbc02d
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e9bbc02d
编写于
8月 12, 2022
作者:
X
xleili
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(docs):add nodejs 3.0 reference sample to CI
上级
d08841d7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
56 addition
and
21 deletion
+56
-21
docs/examples/csharp/QueryExample.cs
docs/examples/csharp/QueryExample.cs
+1
-1
docs/examples/node/nativeexample/connect.js
docs/examples/node/nativeexample/connect.js
+12
-19
docs/examples/node/restexample/connect.js
docs/examples/node/restexample/connect.js
+1
-1
tests/docs-examples-test/node.sh
tests/docs-examples-test/node.sh
+42
-0
未找到文件。
docs/examples/csharp/QueryExample.cs
浏览文件 @
e9bbc02d
...
...
@@ -10,7 +10,7 @@ namespace TDengineExample
{
IntPtr
conn
=
GetConnection
();
// run query
IntPtr
res
=
TDengine
.
Query
(
conn
,
"SELECT * FROM
test.
meters LIMIT 2"
);
IntPtr
res
=
TDengine
.
Query
(
conn
,
"SELECT * FROM meters LIMIT 2"
);
if
(
TDengine
.
ErrorNo
(
res
)
!=
0
)
{
Console
.
WriteLine
(
"Failed to query since: "
+
TDengine
.
Error
(
res
));
...
...
docs/examples/node/nativeexample/connect.js
浏览文件 @
e9bbc02d
const
{
options
,
connect
}
=
require
(
"
@tdengine/rest
"
);
//A cursor also needs to be initialized in order to interact with TDengine from Node.js.
const
taos
=
require
(
"
@tdengine/client
"
);
var
conn
=
taos
.
connect
({
host
:
"
127.0.0.1
"
,
user
:
"
root
"
,
password
:
"
taosdata
"
,
config
:
"
/etc/taos
"
,
port
:
0
,
});
var
cursor
=
conn
.
cursor
();
// Initializing a new cursor
async
function
test
()
{
options
.
path
=
"
/rest/sql
"
;
options
.
host
=
"
localhost
"
;
let
conn
=
connect
(
options
);
let
cursor
=
conn
.
cursor
();
try
{
let
res
=
await
cursor
.
query
(
"
SELECT server_version()
"
);
res
.
toString
();
}
catch
(
err
)
{
console
.
log
(
err
);
}
}
test
();
// output:
// server_version() |
// ===================
// 3.0.0.0 |
//Close a connection
conn
.
close
();
\ No newline at end of file
docs/examples/node/restexample/connect.js
浏览文件 @
e9bbc02d
const
{
options
,
connect
}
=
require
(
"
@tdengine/rest
"
);
async
function
test
()
{
options
.
path
=
"
/rest/sql
t
"
;
options
.
path
=
"
/rest/sql
"
;
options
.
host
=
"
localhost
"
;
let
conn
=
connect
(
options
);
let
cursor
=
conn
.
cursor
();
...
...
tests/docs-examples-test/node.sh
0 → 100644
浏览文件 @
e9bbc02d
#!/bin/bash
set
-e
pgrep taosd
||
taosd
>>
/dev/null 2>&1 &
pgrep taosadapter
||
taosadapter
>>
/dev/null 2>&1 &
cd
../../docs/examples/node
npm
install
cd
restexample
;
node connect.js
cd
../nativeexample
node connect.js
taos
-s
"drop database if exists power"
node insert_example.js
node query_example.js
node async_query_example.js
node subscribe_demo.js
taos
-s
"drop topic if exists topic_name_example"
taos
-s
"drop database if exists power"
node param_bind_example.js
taos
-s
"drop database if exists power"
node multi_bind_example.js
taos
-s
"drop database if exists test"
node influxdb_line_example.js
taos
-s
"drop database if exists test"
node opentsdb_telnet_example.js
taos
-s
"drop database if exists test"
node opentsdb_json_example.js
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录