Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
06721937
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
06721937
编写于
6月 30, 2021
作者:
L
Linhe Huo
提交者:
GitHub
6月 30, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4641]<fix>: fix nodejs query result error (#6448)
Update Node.js connector version to v2.0.8
上级
af88f576
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
18 deletion
+8
-18
src/connector/nodejs/nodetaos/cinterface.js
src/connector/nodejs/nodetaos/cinterface.js
+7
-17
src/connector/nodejs/package.json
src/connector/nodejs/package.json
+1
-1
未找到文件。
src/connector/nodejs/nodetaos/cinterface.js
浏览文件 @
06721937
...
...
@@ -126,30 +126,20 @@ function convertDouble(data, num_of_rows, nbytes = 0, offset = 0, micro = false)
}
return
res
;
}
function
convertBinary
(
data
,
num_of_rows
,
nbytes
=
0
,
offset
=
0
,
micro
=
false
)
{
function
convertNchar
(
data
,
num_of_rows
,
nbytes
=
0
,
offset
=
0
,
micro
=
false
)
{
data
=
ref
.
reinterpret
(
data
.
deref
(),
nbytes
*
num_of_rows
,
offset
);
let
res
=
[];
let
currOffset
=
0
;
while
(
currOffset
<
data
.
length
)
{
let
dataEntry
=
data
.
slice
(
currOffset
,
currOffset
+
nbytes
);
if
(
dataEntry
[
0
]
==
FieldTypes
.
C_BINARY_NULL
)
{
res
.
push
(
null
);
}
else
{
res
.
push
(
ref
.
readCString
(
dataEntry
));
}
let
len
=
data
.
readIntLE
(
currOffset
,
2
);
let
dataEntry
=
data
.
slice
(
currOffset
+
2
,
currOffset
+
len
+
2
);
//one entry in a row under a column;
res
.
push
(
dataEntry
.
toString
(
"
utf-8
"
));
currOffset
+=
nbytes
;
}
return
res
;
}
function
convertNchar
(
data
,
num_of_rows
,
nbytes
=
0
,
offset
=
0
,
micro
=
false
)
{
data
=
ref
.
reinterpret
(
data
.
deref
(),
nbytes
*
num_of_rows
,
offset
);
let
res
=
[];
let
dataEntry
=
data
.
slice
(
0
,
nbytes
);
//one entry in a row under a column;
//TODO: should use the correct character encoding
res
.
push
(
dataEntry
.
toString
(
"
utf-8
"
));
return
res
;
}
// Object with all the relevant converters from pblock data to javascript readable data
let
convertFunctions
=
{
...
...
@@ -160,7 +150,7 @@ let convertFunctions = {
[
FieldTypes
.
C_BIGINT
]:
convertBigint
,
[
FieldTypes
.
C_FLOAT
]:
convertFloat
,
[
FieldTypes
.
C_DOUBLE
]:
convertDouble
,
[
FieldTypes
.
C_BINARY
]:
convert
Binary
,
[
FieldTypes
.
C_BINARY
]:
convert
Nchar
,
[
FieldTypes
.
C_TIMESTAMP
]:
convertTimestamp
,
[
FieldTypes
.
C_NCHAR
]:
convertNchar
}
...
...
src/connector/nodejs/package.json
浏览文件 @
06721937
{
"name"
:
"td2.0-connector"
,
"version"
:
"2.0.
7
"
,
"version"
:
"2.0.
8
"
,
"description"
:
"A Node.js connector for TDengine."
,
"main"
:
"tdengine.js"
,
"directories"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录