@tdengine/websocket 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/example/all_type_query.js +26 -22
- package/lib/example/all_type_stmt.js +22 -20
- package/lib/example/basicBatchTmq.js +14 -14
- package/lib/example/basicSchemaless.js +11 -11
- package/lib/example/basicSql.js +10 -10
- package/lib/example/basicStmt.js +3 -3
- package/lib/example/basicTmq.js +8 -9
- package/lib/index.d.ts +0 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -7
- package/lib/src/client/wsClient.d.ts +2 -2
- package/lib/src/client/wsClient.d.ts.map +1 -1
- package/lib/src/client/wsClient.js +60 -37
- package/lib/src/client/wsConnector.d.ts.map +1 -1
- package/lib/src/client/wsConnector.js +40 -14
- package/lib/src/client/wsConnectorPool.d.ts.map +1 -1
- package/lib/src/client/wsConnectorPool.js +29 -14
- package/lib/src/client/wsEventCallback.d.ts.map +1 -1
- package/lib/src/client/wsEventCallback.js +6 -4
- package/lib/src/client/wsResponse.d.ts.map +1 -1
- package/lib/src/client/wsResponse.js +6 -2
- package/lib/src/common/config.d.ts +2 -2
- package/lib/src/common/config.d.ts.map +1 -1
- package/lib/src/common/config.js +5 -5
- package/lib/src/common/constant.d.ts.map +1 -1
- package/lib/src/common/constant.js +27 -27
- package/lib/src/common/log.d.ts +1 -1
- package/lib/src/common/log.d.ts.map +1 -1
- package/lib/src/common/log.js +9 -7
- package/lib/src/common/reqid.d.ts.map +1 -1
- package/lib/src/common/reqid.js +7 -7
- package/lib/src/common/taosResult.d.ts.map +1 -1
- package/lib/src/common/taosResult.js +46 -27
- package/lib/src/common/ut8Helper.d.ts.map +1 -1
- package/lib/src/common/ut8Helper.js +8 -8
- package/lib/src/common/utils.d.ts.map +1 -1
- package/lib/src/common/utils.js +17 -16
- package/lib/src/common/wsError.d.ts.map +1 -1
- package/lib/src/common/wsError.js +3 -3
- package/lib/src/common/wsOptions.d.ts +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/sql/wsProto.d.ts.map +1 -1
- package/lib/src/sql/wsRows.d.ts +3 -3
- package/lib/src/sql/wsRows.d.ts.map +1 -1
- package/lib/src/sql/wsRows.js +4 -2
- package/lib/src/sql/wsSql.d.ts +5 -5
- package/lib/src/sql/wsSql.d.ts.map +1 -1
- package/lib/src/sql/wsSql.js +15 -16
- package/lib/src/stmt/FieldBindParams.d.ts.map +1 -1
- package/lib/src/stmt/wsColumnInfo.d.ts.map +1 -1
- package/lib/src/stmt/wsParams1.d.ts.map +1 -1
- package/lib/src/stmt/wsParams1.js +50 -24
- package/lib/src/stmt/wsParams2.d.ts.map +1 -1
- package/lib/src/stmt/wsParams2.js +30 -15
- package/lib/src/stmt/wsParamsBase.d.ts.map +1 -1
- package/lib/src/stmt/wsParamsBase.js +5 -3
- package/lib/src/stmt/wsProto.d.ts.map +1 -1
- package/lib/src/stmt/wsProto.js +22 -11
- package/lib/src/stmt/wsStmt.d.ts.map +1 -1
- package/lib/src/stmt/wsStmt1.d.ts +5 -5
- package/lib/src/stmt/wsStmt1.d.ts.map +1 -1
- package/lib/src/stmt/wsStmt1.js +14 -14
- package/lib/src/stmt/wsStmt2.d.ts +1 -1
- package/lib/src/stmt/wsStmt2.d.ts.map +1 -1
- package/lib/src/stmt/wsStmt2.js +18 -14
- package/lib/src/stmt/wsTableInfo.d.ts.map +1 -1
- package/lib/src/tmq/config.d.ts.map +1 -1
- package/lib/src/tmq/config.js +2 -2
- package/lib/src/tmq/constant.d.ts.map +1 -1
- package/lib/src/tmq/constant.js +28 -28
- package/lib/src/tmq/tmqResponse.d.ts.map +1 -1
- package/lib/src/tmq/tmqResponse.js +30 -16
- package/lib/src/tmq/wsTmq.d.ts +2 -2
- package/lib/src/tmq/wsTmq.d.ts.map +1 -1
- package/lib/src/tmq/wsTmq.js +32 -30
- package/lib/test/bulkPulling/cloud.tmq.test.js +11 -11
- package/lib/test/bulkPulling/decimal.test.js +50 -26
- package/lib/test/bulkPulling/log.test.js +8 -8
- package/lib/test/bulkPulling/queryTables.test.js +255 -49
- package/lib/test/bulkPulling/schemaless.test.js +34 -34
- package/lib/test/bulkPulling/sql.test.js +108 -69
- package/lib/test/bulkPulling/stmt1.func.test.js +96 -96
- package/lib/test/bulkPulling/stmt1.type.test.js +124 -48
- package/lib/test/bulkPulling/stmt2.func.test.js +116 -112
- package/lib/test/bulkPulling/stmt2.type.test.js +124 -48
- package/lib/test/bulkPulling/tmq.test.js +225 -31
- package/lib/test/bulkPulling/utils.test.js +2 -2
- package/lib/test/bulkPulling/wsConnectPool.test.js +18 -18
- package/lib/test/utils.d.ts.map +1 -1
- package/lib/test/utils.js +129 -129
- package/package.json +1 -1
- package/readme.md +1 -0
- package/lib/src/stmt/wsParams.d.ts +0 -41
- package/lib/src/stmt/wsParams.d.ts.map +0 -1
- package/lib/src/stmt/wsParams.js +0 -428
- package/lib/test/bulkPulling/stmt.func.test.d.ts +0 -2
- package/lib/test/bulkPulling/stmt.func.test.d.ts.map +0 -1
- package/lib/test/bulkPulling/stmt.func.test.js +0 -493
- package/lib/test/bulkPulling/stmt.type.test.d.ts +0 -2
- package/lib/test/bulkPulling/stmt.type.test.d.ts.map +0 -1
- package/lib/test/bulkPulling/stmt.type.test.js +0 -316
|
@@ -18,13 +18,14 @@ class WsClient {
|
|
|
18
18
|
this._url = url;
|
|
19
19
|
this._timeout = timeout;
|
|
20
20
|
if (this._url.searchParams.has("timezone")) {
|
|
21
|
-
this._timezone =
|
|
21
|
+
this._timezone =
|
|
22
|
+
this._url.searchParams.get("timezone") || undefined;
|
|
22
23
|
this._url.searchParams.delete("timezone");
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
async connect(database) {
|
|
26
27
|
let connMsg = {
|
|
27
|
-
action:
|
|
28
|
+
action: "conn",
|
|
28
29
|
args: {
|
|
29
30
|
req_id: reqid_1.ReqId.getReqID(),
|
|
30
31
|
user: (0, utils_1.safeDecodeURIComponent)(this._url.username),
|
|
@@ -34,7 +35,8 @@ class WsClient {
|
|
|
34
35
|
},
|
|
35
36
|
};
|
|
36
37
|
log_1.default.debug("[wsClient.connect.connMsg]===>" + json_bigint_1.default.stringify(connMsg));
|
|
37
|
-
this._wsConnector =
|
|
38
|
+
this._wsConnector =
|
|
39
|
+
await wsConnectorPool_1.WebSocketConnectionPool.instance().getConnection(this._url, this._timeout);
|
|
38
40
|
if (this._wsConnector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
@@ -45,27 +47,27 @@ class WsClient {
|
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
49
|
await this.close();
|
|
48
|
-
throw
|
|
50
|
+
throw new wsError_1.WebSocketQueryError(result.msg.code, result.msg.message);
|
|
49
51
|
}
|
|
50
52
|
catch (e) {
|
|
51
53
|
await this.close();
|
|
52
54
|
log_1.default.error(`connection creation failed, url: ${this._url}, code:${e.code}, msg:${e.message}`);
|
|
53
|
-
throw
|
|
55
|
+
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WEBSOCKET_CONNECTION_FAIL, `connection creation failed, url: ${this._url}, code:${e.code}, msg:${e.message}`);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
async setOptionConnection(option, value) {
|
|
57
59
|
log_1.default.debug("[wsClient.setOptionConnection]===>" + option + ", " + value);
|
|
58
60
|
let connMsg = {
|
|
59
|
-
action:
|
|
61
|
+
action: "options_connection",
|
|
60
62
|
args: {
|
|
61
63
|
req_id: reqid_1.ReqId.getReqID(),
|
|
62
64
|
options: [
|
|
63
65
|
{
|
|
64
66
|
option: option,
|
|
65
|
-
value: value
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
67
|
+
value: value,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
69
71
|
};
|
|
70
72
|
try {
|
|
71
73
|
await this.exec(json_bigint_1.default.stringify(connMsg), false);
|
|
@@ -76,19 +78,23 @@ class WsClient {
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
async execNoResp(queryMsg) {
|
|
79
|
-
log_1.default.debug(
|
|
80
|
-
if (this._wsConnector &&
|
|
81
|
+
log_1.default.debug("[wsQueryInterface.query.queryMsg]===>" + queryMsg);
|
|
82
|
+
if (this._wsConnector &&
|
|
83
|
+
this._wsConnector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
81
84
|
await this._wsConnector.sendMsgNoResp(queryMsg);
|
|
82
85
|
return;
|
|
83
86
|
}
|
|
84
|
-
throw
|
|
87
|
+
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect");
|
|
85
88
|
}
|
|
86
89
|
// need to construct Response.
|
|
87
90
|
async exec(queryMsg, bSqlQuery = true) {
|
|
88
91
|
return new Promise((resolve, reject) => {
|
|
89
|
-
log_1.default.debug(
|
|
90
|
-
if (this._wsConnector &&
|
|
91
|
-
this._wsConnector.
|
|
92
|
+
log_1.default.debug("[wsQueryInterface.query.queryMsg]===>" + queryMsg);
|
|
93
|
+
if (this._wsConnector &&
|
|
94
|
+
this._wsConnector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
95
|
+
this._wsConnector
|
|
96
|
+
.sendMsg(queryMsg)
|
|
97
|
+
.then((e) => {
|
|
92
98
|
if (e.msg.code == 0) {
|
|
93
99
|
if (bSqlQuery) {
|
|
94
100
|
resolve(new wsResponse_1.WSQueryResponse(e));
|
|
@@ -100,7 +106,10 @@ class WsClient {
|
|
|
100
106
|
else {
|
|
101
107
|
reject(new wsError_1.WebSocketInterfaceError(e.msg.code, e.msg.message));
|
|
102
108
|
}
|
|
103
|
-
})
|
|
109
|
+
})
|
|
110
|
+
.catch((e) => {
|
|
111
|
+
reject(e);
|
|
112
|
+
});
|
|
104
113
|
}
|
|
105
114
|
else {
|
|
106
115
|
reject(new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
|
|
@@ -110,8 +119,11 @@ class WsClient {
|
|
|
110
119
|
// need to construct Response.
|
|
111
120
|
async sendBinaryMsg(reqId, action, message, bSqlQuery = true, bResultBinary = false) {
|
|
112
121
|
return new Promise((resolve, reject) => {
|
|
113
|
-
if (this._wsConnector &&
|
|
114
|
-
this._wsConnector.
|
|
122
|
+
if (this._wsConnector &&
|
|
123
|
+
this._wsConnector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
124
|
+
this._wsConnector
|
|
125
|
+
.sendBinaryMsg(reqId, action, message)
|
|
126
|
+
.then((e) => {
|
|
115
127
|
if (bResultBinary) {
|
|
116
128
|
resolve(e);
|
|
117
129
|
}
|
|
@@ -126,7 +138,10 @@ class WsClient {
|
|
|
126
138
|
else {
|
|
127
139
|
reject(new wsError_1.WebSocketInterfaceError(e.msg.code, e.msg.message));
|
|
128
140
|
}
|
|
129
|
-
})
|
|
141
|
+
})
|
|
142
|
+
.catch((e) => {
|
|
143
|
+
reject(e);
|
|
144
|
+
});
|
|
130
145
|
}
|
|
131
146
|
else {
|
|
132
147
|
reject(new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
|
|
@@ -141,7 +156,8 @@ class WsClient {
|
|
|
141
156
|
}
|
|
142
157
|
async ready() {
|
|
143
158
|
try {
|
|
144
|
-
this._wsConnector =
|
|
159
|
+
this._wsConnector =
|
|
160
|
+
await wsConnectorPool_1.WebSocketConnectionPool.instance().getConnection(this._url, this._timeout);
|
|
145
161
|
if (this._wsConnector.readyState() !== websocket_1.w3cwebsocket.OPEN) {
|
|
146
162
|
await this._wsConnector.ready();
|
|
147
163
|
}
|
|
@@ -150,16 +166,20 @@ class WsClient {
|
|
|
150
166
|
}
|
|
151
167
|
catch (e) {
|
|
152
168
|
log_1.default.error(`connection creation failed, url: ${this._url}, code: ${e.code}, message: ${e.message}`);
|
|
153
|
-
throw
|
|
169
|
+
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WEBSOCKET_CONNECTION_FAIL, `connection creation failed, url: ${this._url}, code: ${e.code}, message: ${e.message}`);
|
|
154
170
|
}
|
|
155
171
|
}
|
|
156
172
|
async sendMsg(msg) {
|
|
157
173
|
return new Promise((resolve, reject) => {
|
|
158
174
|
log_1.default.debug("[wsQueryInterface.sendMsg]===>" + msg);
|
|
159
|
-
if (this._wsConnector &&
|
|
160
|
-
this._wsConnector.
|
|
175
|
+
if (this._wsConnector &&
|
|
176
|
+
this._wsConnector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
177
|
+
this._wsConnector
|
|
178
|
+
.sendMsg(msg)
|
|
179
|
+
.then((e) => {
|
|
161
180
|
resolve(e);
|
|
162
|
-
})
|
|
181
|
+
})
|
|
182
|
+
.catch((e) => reject(e));
|
|
163
183
|
}
|
|
164
184
|
else {
|
|
165
185
|
reject(new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
|
|
@@ -168,7 +188,7 @@ class WsClient {
|
|
|
168
188
|
}
|
|
169
189
|
async freeResult(res) {
|
|
170
190
|
let freeResultMsg = {
|
|
171
|
-
action:
|
|
191
|
+
action: "free_result",
|
|
172
192
|
args: {
|
|
173
193
|
req_id: reqid_1.ReqId.getReqID(),
|
|
174
194
|
id: res.id,
|
|
@@ -177,9 +197,13 @@ class WsClient {
|
|
|
177
197
|
return new Promise((resolve, reject) => {
|
|
178
198
|
let jsonStr = json_bigint_1.default.stringify(freeResultMsg);
|
|
179
199
|
log_1.default.debug("[wsQueryInterface.freeResult.freeResultMsg]===>" + jsonStr);
|
|
180
|
-
if (this._wsConnector &&
|
|
181
|
-
this._wsConnector.
|
|
182
|
-
|
|
200
|
+
if (this._wsConnector &&
|
|
201
|
+
this._wsConnector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
202
|
+
this._wsConnector
|
|
203
|
+
.sendMsgNoResp(jsonStr)
|
|
204
|
+
.then((e) => {
|
|
205
|
+
resolve(e);
|
|
206
|
+
})
|
|
183
207
|
.catch((e) => reject(e));
|
|
184
208
|
}
|
|
185
209
|
else {
|
|
@@ -192,9 +216,9 @@ class WsClient {
|
|
|
192
216
|
return this._version;
|
|
193
217
|
}
|
|
194
218
|
let versionMsg = {
|
|
195
|
-
action:
|
|
219
|
+
action: "version",
|
|
196
220
|
args: {
|
|
197
|
-
req_id: reqid_1.ReqId.getReqID()
|
|
221
|
+
req_id: reqid_1.ReqId.getReqID(),
|
|
198
222
|
},
|
|
199
223
|
};
|
|
200
224
|
if (this._wsConnector) {
|
|
@@ -206,11 +230,11 @@ class WsClient {
|
|
|
206
230
|
if (result.msg.code == 0) {
|
|
207
231
|
return new wsResponse_1.WSVersionResponse(result).version;
|
|
208
232
|
}
|
|
209
|
-
throw
|
|
233
|
+
throw new wsError_1.WebSocketInterfaceError(result.msg.code, result.msg.message);
|
|
210
234
|
}
|
|
211
235
|
catch (e) {
|
|
212
236
|
log_1.default.error(`connection creation failed, url: ${this._url}, code: ${e.code}, message: ${e.message}`);
|
|
213
|
-
throw
|
|
237
|
+
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WEBSOCKET_CONNECTION_FAIL, `connection creation failed, url: ${this._url}, code: ${e.code}, message: ${e.message}`);
|
|
214
238
|
}
|
|
215
239
|
}
|
|
216
240
|
throw (wsError_1.ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect");
|
|
@@ -219,14 +243,13 @@ class WsClient {
|
|
|
219
243
|
if (this._wsConnector) {
|
|
220
244
|
await wsConnectorPool_1.WebSocketConnectionPool.instance().releaseConnection(this._wsConnector);
|
|
221
245
|
this._wsConnector = undefined;
|
|
222
|
-
// this._wsConnector.close();
|
|
223
246
|
}
|
|
224
247
|
}
|
|
225
248
|
checkURL(url) {
|
|
226
249
|
// Assert is cloud url
|
|
227
|
-
if (!url.searchParams.has(
|
|
250
|
+
if (!url.searchParams.has("token")) {
|
|
228
251
|
if (!(url.username || url.password)) {
|
|
229
|
-
throw new wsError_1.WebSocketInterfaceError(wsError_1.ErrorCode.ERR_INVALID_AUTHENTICATION,
|
|
252
|
+
throw new wsError_1.WebSocketInterfaceError(wsError_1.ErrorCode.ERR_INVALID_AUTHENTICATION, "invalid url, password or username needed.");
|
|
230
253
|
}
|
|
231
254
|
}
|
|
232
255
|
}
|
|
@@ -235,7 +258,7 @@ class WsClient {
|
|
|
235
258
|
let result = (0, utils_1.compareVersions)(this._version, WsClient._minVersion);
|
|
236
259
|
if (result < 0) {
|
|
237
260
|
log_1.default.error(`TDengine version is too low, current version: ${this._version}, minimum required version: ${WsClient._minVersion}`);
|
|
238
|
-
throw
|
|
261
|
+
throw new wsError_1.WebSocketQueryError(wsError_1.ErrorCode.ERR_TDENIGNE_VERSION_IS_TOO_LOW, `Version mismatch. The minimum required TDengine version is ${WsClient._minVersion}`);
|
|
239
262
|
}
|
|
240
263
|
}
|
|
241
264
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsConnector.d.ts","sourceRoot":"","sources":["../../../src/client/wsConnector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wsConnector.d.ts","sourceRoot":"","sources":["../../../src/client/wsConnector.ts"],"names":[],"mappings":"AAUA,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,MAAM,CAAM;IACpB,QAAQ,SAAQ;gBAGJ,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAuClD,KAAK;YA6BG,QAAQ;IAItB,OAAO,CAAC,UAAU;IA4BlB,KAAK;IAWL,UAAU,IAAI,MAAM;IAId,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB7C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAc;IAqCjD,aAAa,CACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,EACpB,QAAQ,GAAE,OAAc;IAkCrB,QAAQ,IAAI,GAAG;CAGzB"}
|
|
@@ -22,8 +22,13 @@ class WebSocketConnector {
|
|
|
22
22
|
if (timeout) {
|
|
23
23
|
this._timeout = timeout;
|
|
24
24
|
}
|
|
25
|
-
this._wsConn = new websocket_1.w3cwebsocket(origin.concat(pathname).concat(search), undefined, undefined, undefined, undefined, {
|
|
26
|
-
|
|
25
|
+
this._wsConn = new websocket_1.w3cwebsocket(origin.concat(pathname).concat(search), undefined, undefined, undefined, undefined, {
|
|
26
|
+
maxReceivedFrameSize: 0x60000000,
|
|
27
|
+
maxReceivedMessageSize: 0x60000000,
|
|
28
|
+
});
|
|
29
|
+
this._wsConn.onerror = function (err) {
|
|
30
|
+
log_1.default.error(`webSocket connection failed, url: ${this.url}, error: ${err.message}`);
|
|
31
|
+
};
|
|
27
32
|
this._wsConn.onclose = this._onclose;
|
|
28
33
|
this._wsConn.onmessage = this._onmessage;
|
|
29
34
|
this._wsConn._binaryType = "arraybuffer";
|
|
@@ -35,11 +40,19 @@ class WebSocketConnector {
|
|
|
35
40
|
async ready() {
|
|
36
41
|
return new Promise((resolve, reject) => {
|
|
37
42
|
let reqId = reqid_1.ReqId.getReqID();
|
|
38
|
-
wsEventCallback_1.WsEventCallback.instance().registerCallback({
|
|
39
|
-
|
|
43
|
+
wsEventCallback_1.WsEventCallback.instance().registerCallback({
|
|
44
|
+
action: "websocket_connection",
|
|
45
|
+
req_id: BigInt(reqId),
|
|
46
|
+
timeout: this._timeout,
|
|
47
|
+
id: BigInt(reqId),
|
|
48
|
+
}, resolve, reject);
|
|
40
49
|
this._wsConn.onopen = () => {
|
|
41
50
|
log_1.default.debug("websocket connection opened");
|
|
42
|
-
wsEventCallback_1.WsEventCallback.instance().handleEventCallback({
|
|
51
|
+
wsEventCallback_1.WsEventCallback.instance().handleEventCallback({
|
|
52
|
+
id: BigInt(reqId),
|
|
53
|
+
action: "websocket_connection",
|
|
54
|
+
req_id: BigInt(reqId),
|
|
55
|
+
}, wsEventCallback_1.OnMessageType.MESSAGE_TYPE_CONNECTION, this);
|
|
43
56
|
};
|
|
44
57
|
});
|
|
45
58
|
}
|
|
@@ -48,12 +61,12 @@ class WebSocketConnector {
|
|
|
48
61
|
}
|
|
49
62
|
_onmessage(event) {
|
|
50
63
|
let data = event.data;
|
|
51
|
-
log_1.default.debug("wsClient._onMessage()====" +
|
|
52
|
-
if (Object.prototype.toString.call(data) ===
|
|
64
|
+
log_1.default.debug("wsClient._onMessage()====" + Object.prototype.toString.call(data));
|
|
65
|
+
if (Object.prototype.toString.call(data) === "[object ArrayBuffer]") {
|
|
53
66
|
let id = new DataView(data, 26, 8).getBigUint64(0, true);
|
|
54
|
-
wsEventCallback_1.WsEventCallback.instance().handleEventCallback({ id: id, action:
|
|
67
|
+
wsEventCallback_1.WsEventCallback.instance().handleEventCallback({ id: id, action: "", req_id: BigInt(0) }, wsEventCallback_1.OnMessageType.MESSAGE_TYPE_ARRAYBUFFER, data);
|
|
55
68
|
}
|
|
56
|
-
else if (Object.prototype.toString.call(data) ===
|
|
69
|
+
else if (Object.prototype.toString.call(data) === "[object String]") {
|
|
57
70
|
let msg = JSON.parse(data);
|
|
58
71
|
log_1.default.debug("[_onmessage.stringType]==>:" + data);
|
|
59
72
|
wsEventCallback_1.WsEventCallback.instance().handleEventCallback({ id: BigInt(0), action: msg.action, req_id: msg.req_id }, wsEventCallback_1.OnMessageType.MESSAGE_TYPE_STRING, msg);
|
|
@@ -98,8 +111,14 @@ class WebSocketConnector {
|
|
|
98
111
|
return new Promise((resolve, reject) => {
|
|
99
112
|
if (this._wsConn && this._wsConn.readyState === websocket_1.w3cwebsocket.OPEN) {
|
|
100
113
|
if (register) {
|
|
101
|
-
wsEventCallback_1.WsEventCallback.instance().registerCallback({
|
|
102
|
-
|
|
114
|
+
wsEventCallback_1.WsEventCallback.instance().registerCallback({
|
|
115
|
+
action: msg.action,
|
|
116
|
+
req_id: msg.args.req_id,
|
|
117
|
+
timeout: this._timeout,
|
|
118
|
+
id: msg.args.id === undefined
|
|
119
|
+
? msg.args.id
|
|
120
|
+
: BigInt(msg.args.id),
|
|
121
|
+
}, resolve, reject);
|
|
103
122
|
}
|
|
104
123
|
log_1.default.debug(`[wsClient.sendMessage.msg]===> ${message}`);
|
|
105
124
|
this._wsConn.send(message);
|
|
@@ -113,10 +132,17 @@ class WebSocketConnector {
|
|
|
113
132
|
return new Promise((resolve, reject) => {
|
|
114
133
|
if (this._wsConn && this._wsConn.readyState === websocket_1.w3cwebsocket.OPEN) {
|
|
115
134
|
if (register) {
|
|
116
|
-
wsEventCallback_1.WsEventCallback.instance().registerCallback({
|
|
117
|
-
|
|
135
|
+
wsEventCallback_1.WsEventCallback.instance().registerCallback({
|
|
136
|
+
action: action,
|
|
137
|
+
req_id: reqId,
|
|
138
|
+
timeout: this._timeout,
|
|
139
|
+
id: reqId,
|
|
140
|
+
}, resolve, reject);
|
|
118
141
|
}
|
|
119
|
-
log_1.default.debug("[wsClient.sendBinaryMsg()]===>" +
|
|
142
|
+
log_1.default.debug("[wsClient.sendBinaryMsg()]===>" +
|
|
143
|
+
reqId +
|
|
144
|
+
action +
|
|
145
|
+
message.byteLength);
|
|
120
146
|
this._wsConn.send(message);
|
|
121
147
|
}
|
|
122
148
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsConnectorPool.d.ts","sourceRoot":"","sources":["../../../src/client/wsConnectorPool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"wsConnectorPool.d.ts","sourceRoot":"","sources":["../../../src/client/wsConnectorPool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOnD,qBAAa,uBAAuB;IAChC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAA0B;IACnD,OAAO,CAAC,IAAI,CAAgD;IAC5D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAoB;IAC/C,OAAO,CAAC,MAAM,CAAC,WAAW,CAAa;IAEvC,OAAO;WASO,QAAQ,CAClB,cAAc,GAAE,MAAW,GAC5B,uBAAuB;IASpB,aAAa,CACf,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GACnC,OAAO,CAAC,kBAAkB,CAAC;IA4DxB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCrE,SAAS;CAmBZ"}
|
|
@@ -36,7 +36,8 @@ class WebSocketConnectionPool {
|
|
|
36
36
|
if (!candidate) {
|
|
37
37
|
continue;
|
|
38
38
|
}
|
|
39
|
-
if (candidate &&
|
|
39
|
+
if (candidate &&
|
|
40
|
+
candidate.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
40
41
|
connector = candidate;
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
@@ -48,14 +49,21 @@ class WebSocketConnectionPool {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
if (connector) {
|
|
51
|
-
log_1.default.debug("get connection success:" +
|
|
52
|
+
log_1.default.debug("get connection success:" +
|
|
53
|
+
Atomics.load(WebSocketConnectionPool.sharedArray, 0));
|
|
52
54
|
return connector;
|
|
53
55
|
}
|
|
54
|
-
if (this._maxConnections != -1 &&
|
|
55
|
-
|
|
56
|
+
if (this._maxConnections != -1 &&
|
|
57
|
+
Atomics.load(WebSocketConnectionPool.sharedArray, 0) >
|
|
58
|
+
this._maxConnections) {
|
|
59
|
+
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WEBSOCKET_CONNECTION_ARRIVED_LIMIT, "websocket connect arrived limited:" +
|
|
60
|
+
Atomics.load(WebSocketConnectionPool.sharedArray, 0));
|
|
56
61
|
}
|
|
57
62
|
Atomics.add(WebSocketConnectionPool.sharedArray, 0, 1);
|
|
58
|
-
log_1.default.info("getConnection, new connection count:" +
|
|
63
|
+
log_1.default.info("getConnection, new connection count:" +
|
|
64
|
+
Atomics.load(WebSocketConnectionPool.sharedArray, 0) +
|
|
65
|
+
", connectAddr:" +
|
|
66
|
+
connectAddr);
|
|
59
67
|
return new wsConnector_1.WebSocketConnector(url, timeout);
|
|
60
68
|
}
|
|
61
69
|
finally {
|
|
@@ -68,7 +76,9 @@ class WebSocketConnectionPool {
|
|
|
68
76
|
try {
|
|
69
77
|
if (connector.readyState() === websocket_1.w3cwebsocket.OPEN) {
|
|
70
78
|
let url = connector.getWsURL();
|
|
71
|
-
let connectAddr = url.origin
|
|
79
|
+
let connectAddr = url.origin
|
|
80
|
+
.concat(url.pathname)
|
|
81
|
+
.concat(url.search);
|
|
72
82
|
let connectors = this.pool.get(connectAddr);
|
|
73
83
|
if (!connectors) {
|
|
74
84
|
connectors = new Array();
|
|
@@ -78,12 +88,14 @@ class WebSocketConnectionPool {
|
|
|
78
88
|
else {
|
|
79
89
|
connectors.push(connector);
|
|
80
90
|
}
|
|
81
|
-
log_1.default.info("releaseConnection, current connection count:" +
|
|
91
|
+
log_1.default.info("releaseConnection, current connection count:" +
|
|
92
|
+
connectors.length);
|
|
82
93
|
}
|
|
83
94
|
else {
|
|
84
95
|
Atomics.add(WebSocketConnectionPool.sharedArray, 0, -1);
|
|
85
96
|
connector.close();
|
|
86
|
-
log_1.default.info("releaseConnection, current connection status fail:" +
|
|
97
|
+
log_1.default.info("releaseConnection, current connection status fail:" +
|
|
98
|
+
Atomics.load(WebSocketConnectionPool.sharedArray, 0));
|
|
87
99
|
}
|
|
88
100
|
}
|
|
89
101
|
finally {
|
|
@@ -101,24 +113,27 @@ class WebSocketConnectionPool {
|
|
|
101
113
|
}
|
|
102
114
|
}
|
|
103
115
|
}
|
|
104
|
-
log_1.default.info("destroyed connect:" +
|
|
116
|
+
log_1.default.info("destroyed connect:" +
|
|
117
|
+
Atomics.load(WebSocketConnectionPool.sharedArray, 0) +
|
|
118
|
+
" current count:" +
|
|
119
|
+
num);
|
|
105
120
|
Atomics.store(WebSocketConnectionPool.sharedArray, 0, 0);
|
|
106
121
|
this.pool = new Map();
|
|
107
122
|
}
|
|
108
123
|
}
|
|
109
124
|
exports.WebSocketConnectionPool = WebSocketConnectionPool;
|
|
110
|
-
process.on(
|
|
125
|
+
process.on("exit", (code) => {
|
|
111
126
|
log_1.default.info("begin destroy connect");
|
|
112
127
|
WebSocketConnectionPool.instance().destroyed();
|
|
113
128
|
process.exit();
|
|
114
129
|
});
|
|
115
|
-
process.on(
|
|
116
|
-
log_1.default.info(
|
|
130
|
+
process.on("SIGINT", () => {
|
|
131
|
+
log_1.default.info("Received SIGINT. Press Control-D to exit, begin destroy connect...");
|
|
117
132
|
WebSocketConnectionPool.instance().destroyed();
|
|
118
133
|
process.exit();
|
|
119
134
|
});
|
|
120
|
-
process.on(
|
|
121
|
-
log_1.default.info(
|
|
135
|
+
process.on("SIGTERM", () => {
|
|
136
|
+
log_1.default.info("Received SIGINT. Press Control-D to exit, begin destroy connect");
|
|
122
137
|
WebSocketConnectionPool.instance().destroyed();
|
|
123
138
|
process.exit();
|
|
124
139
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsEventCallback.d.ts","sourceRoot":"","sources":["../../../src/client/wsEventCallback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wsEventCallback.d.ts","sourceRoot":"","sources":["../../../src/client/wsEventCallback.ts"],"names":[],"mappings":"AASA,UAAU,SAAS;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,oBAAY,aAAa;IACrB,wBAAwB,IAAI;IAC5B,iBAAiB,IAAI;IACrB,mBAAmB,IAAI;IACvB,uBAAuB,IAAI;CAC9B;AAGD,qBAAa,eAAe;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAkB;IAC3C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CACnB;IACd,OAAO;WAEO,QAAQ,IAAI,eAAe;IAOnC,gBAAgB,CAClB,EAAE,EAAE,SAAS,EACb,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAC5B,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;IAwBxB,mBAAmB,CACrB,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,aAAa,EAC1B,IAAI,EAAE,GAAG;CA0DhB"}
|
|
@@ -16,8 +16,7 @@ var OnMessageType;
|
|
|
16
16
|
})(OnMessageType || (exports.OnMessageType = OnMessageType = {}));
|
|
17
17
|
const eventMutex = new async_mutex_1.Mutex();
|
|
18
18
|
class WsEventCallback {
|
|
19
|
-
constructor() {
|
|
20
|
-
}
|
|
19
|
+
constructor() { }
|
|
21
20
|
static instance() {
|
|
22
21
|
if (!WsEventCallback._instance) {
|
|
23
22
|
WsEventCallback._instance = new WsEventCallback();
|
|
@@ -31,7 +30,7 @@ class WsEventCallback {
|
|
|
31
30
|
sendTime: new Date().getTime(),
|
|
32
31
|
reject: rej,
|
|
33
32
|
resolve: res,
|
|
34
|
-
timer: setTimeout(() => rej(new wsError_1.WebSocketQueryError(wsError_1.ErrorCode.ERR_WEBSOCKET_QUERY_TIMEOUT, `action:${id.action},req_id:${id.req_id} timeout with ${id.timeout} milliseconds`)), id.timeout)
|
|
33
|
+
timer: setTimeout(() => rej(new wsError_1.WebSocketQueryError(wsError_1.ErrorCode.ERR_WEBSOCKET_QUERY_TIMEOUT, `action:${id.action},req_id:${id.req_id} timeout with ${id.timeout} milliseconds`)), id.timeout),
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
finally {
|
|
@@ -88,7 +87,10 @@ class WsEventCallback {
|
|
|
88
87
|
}
|
|
89
88
|
else {
|
|
90
89
|
log_1.default.error("no find callback msg:=", msg);
|
|
91
|
-
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WS_NO_CALLBACK, "no callback registered for fetch_block with req_id=" +
|
|
90
|
+
throw new wsError_1.TDWebSocketClientError(wsError_1.ErrorCode.ERR_WS_NO_CALLBACK, "no callback registered for fetch_block with req_id=" +
|
|
91
|
+
msg.req_id +
|
|
92
|
+
" action" +
|
|
93
|
+
msg.action);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wsResponse.d.ts","sourceRoot":"","sources":["../../../src/client/wsResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,iBAAiB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;gBACN,IAAI,
|
|
1
|
+
{"version":3,"file":"wsResponse.d.ts","sourceRoot":"","sources":["../../../src/client/wsResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAe,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,iBAAiB;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;gBACN,IAAI,EAAE,WAAW;CAOhC;AAED,qBAAa,eAAe;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE,WAAW;IAI7B,OAAO,CAAC,OAAO;CA0BlB;AAED,qBAAa,oBAAoB;IAC7B,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;gBACb,GAAG,EAAE,WAAW;CA+B/B"}
|
|
@@ -39,8 +39,12 @@ class WSQueryResponse {
|
|
|
39
39
|
this.fields_types = msg.fields_types;
|
|
40
40
|
this.fields_lengths = msg.fields_lengths;
|
|
41
41
|
this.precision = msg.precision;
|
|
42
|
-
this.fields_precisions = msg.fields_precisions
|
|
43
|
-
|
|
42
|
+
this.fields_precisions = msg.fields_precisions
|
|
43
|
+
? msg.fields_precisions.map((p) => BigInt(p))
|
|
44
|
+
: [];
|
|
45
|
+
this.fields_scales = msg.fields_scales
|
|
46
|
+
? msg.fields_scales.map((s) => BigInt(s))
|
|
47
|
+
: [];
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
exports.WSQueryResponse = WSQueryResponse;
|
|
@@ -18,10 +18,10 @@ export declare class WSConfig {
|
|
|
18
18
|
setDb(db: string): void;
|
|
19
19
|
getUrl(): string;
|
|
20
20
|
setUrl(url: string): void;
|
|
21
|
-
setTimeOut(ms: number): void;
|
|
22
21
|
getTimeOut(): number | undefined | null;
|
|
23
|
-
|
|
22
|
+
setTimeOut(ms: number): void;
|
|
24
23
|
getTimezone(): string | undefined | null;
|
|
24
|
+
setTimezone(timezone: string): void;
|
|
25
25
|
getMinStmt2Version(): string;
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/common/config.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IACjB,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/common/config.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IACjB,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,gBAAgB,CAAS;gBAErB,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;IAS1C,QAAQ,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI;IAIrC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,OAAO,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI;IAIpC,OAAO,CAAC,IAAI,EAAE,MAAM;IAIpB,MAAM,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI;IAInC,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,KAAK,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI;IAIlC,KAAK,CAAC,EAAE,EAAE,MAAM;IAIhB,MAAM,IAAI,MAAM;IAIhB,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,UAAU,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI;IAIvC,UAAU,CAAC,EAAE,EAAE,MAAM;IAIrB,WAAW,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI;IAIxC,WAAW,CAAC,QAAQ,EAAE,MAAM;IAI5B,kBAAkB;CAG5B"}
|
package/lib/src/common/config.js
CHANGED
|
@@ -42,18 +42,18 @@ class WSConfig {
|
|
|
42
42
|
setUrl(url) {
|
|
43
43
|
this._url = url;
|
|
44
44
|
}
|
|
45
|
-
setTimeOut(ms) {
|
|
46
|
-
this._timeout = ms;
|
|
47
|
-
}
|
|
48
45
|
getTimeOut() {
|
|
49
46
|
return this._timeout;
|
|
50
47
|
}
|
|
51
|
-
|
|
52
|
-
this.
|
|
48
|
+
setTimeOut(ms) {
|
|
49
|
+
this._timeout = ms;
|
|
53
50
|
}
|
|
54
51
|
getTimezone() {
|
|
55
52
|
return this._timezone;
|
|
56
53
|
}
|
|
54
|
+
setTimezone(timezone) {
|
|
55
|
+
this._timezone = timezone;
|
|
56
|
+
}
|
|
57
57
|
getMinStmt2Version() {
|
|
58
58
|
return this._minStmt2Version;
|
|
59
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/common/constant.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/common/constant.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC5B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAkB,CAAC;AACpD,eAAO,MAAM,oBAAoB,EAAE,MAAkB,CAAC;AACtD,eAAO,MAAM,eAAe,EAAE,MAAkB,CAAC;AACjD,eAAO,MAAM,gBAAgB,EAAE,eAmB9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,eAM9B,CAAC;AAEF,oBAAY,gBAAgB;IACxB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,GAAG,IAAI;IACP,MAAM,IAAI;IACV,KAAK,IAAI;IACT,MAAM,IAAI;IACV,MAAM,IAAI;IACV,OAAO,IAAI;IACX,SAAS,IAAI;IACb,KAAK,KAAK;IACV,gBAAgB,KAAK;IACrB,iBAAiB,KAAK;IACtB,YAAY,KAAK;IACjB,eAAe,KAAK;IACpB,IAAI,KAAK;IACT,SAAS,KAAK;IACd,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,SAAS,KAAK;CACjB;AAED,oBAAY,sBAAsB;IAC9B,8BAA8B,IAAA,CAAG,qDAAqD;IACtF,+BAA+B,IAAA,CAAE,sDAAsD;IACvF,8BAA8B,IAAA,CAAG,UAAU;IAC3C,+BAA+B,IAAA;CAClC;AAED,oBAAY,aAAa;IACrB,cAAc,IAAI;IAClB,cAAc,IAAI;IAClB,gBAAgB,IAAI;IACpB,iBAAiB,IAAI;CACxB;AAED,eAAO,MAAM,iBAAiB,EAAE,eAI/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAahC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAI7B,CAAC"}
|
|
@@ -5,31 +5,31 @@ exports.BinaryQueryMessage = BigInt(6);
|
|
|
5
5
|
exports.FetchRawBlockMessage = BigInt(7);
|
|
6
6
|
exports.MinStmt2Version = "3.3.6.0";
|
|
7
7
|
exports.TDengineTypeName = {
|
|
8
|
-
0:
|
|
9
|
-
1:
|
|
10
|
-
2:
|
|
11
|
-
3:
|
|
12
|
-
4:
|
|
13
|
-
5:
|
|
14
|
-
6:
|
|
15
|
-
7:
|
|
16
|
-
8:
|
|
17
|
-
9:
|
|
18
|
-
10:
|
|
19
|
-
11:
|
|
20
|
-
12:
|
|
21
|
-
13:
|
|
22
|
-
14:
|
|
23
|
-
15:
|
|
24
|
-
16:
|
|
25
|
-
20:
|
|
8
|
+
0: "NULL",
|
|
9
|
+
1: "BOOL",
|
|
10
|
+
2: "TINYINT",
|
|
11
|
+
3: "SMALLINT",
|
|
12
|
+
4: "INT",
|
|
13
|
+
5: "BIGINT",
|
|
14
|
+
6: "FLOAT",
|
|
15
|
+
7: "DOUBLE",
|
|
16
|
+
8: "VARCHAR",
|
|
17
|
+
9: "TIMESTAMP",
|
|
18
|
+
10: "NCHAR",
|
|
19
|
+
11: "TINYINT UNSIGNED",
|
|
20
|
+
12: "SMALLINT UNSIGNED",
|
|
21
|
+
13: "INT UNSIGNED",
|
|
22
|
+
14: "BIGINT UNSIGNED",
|
|
23
|
+
15: "JSON",
|
|
24
|
+
16: "VARBINARY",
|
|
25
|
+
20: "GEOMETRY",
|
|
26
26
|
};
|
|
27
27
|
exports.ColumnsBlockType = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
SOLID: 0,
|
|
29
|
+
VARCHAR: 1,
|
|
30
|
+
NCHAR: 2,
|
|
31
|
+
GEOMETRY: 3,
|
|
32
|
+
VARBINARY: 4,
|
|
33
33
|
};
|
|
34
34
|
var TDengineTypeCode;
|
|
35
35
|
(function (TDengineTypeCode) {
|
|
@@ -70,7 +70,7 @@ var FieldBindType;
|
|
|
70
70
|
FieldBindType[FieldBindType["TAOS_FIELD_TBNAME"] = 4] = "TAOS_FIELD_TBNAME";
|
|
71
71
|
})(FieldBindType || (exports.FieldBindType = FieldBindType = {}));
|
|
72
72
|
exports.TDenginePrecision = {
|
|
73
|
-
0:
|
|
73
|
+
0: "MILLISECOND",
|
|
74
74
|
1: "MICROSECOND",
|
|
75
75
|
2: "NANOSECOND",
|
|
76
76
|
};
|
|
@@ -89,7 +89,7 @@ exports.TDengineTypeLength = {
|
|
|
89
89
|
[TDengineTypeCode.BIGINT_UNSIGNED]: 8,
|
|
90
90
|
};
|
|
91
91
|
exports.PrecisionLength = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
ms: 13,
|
|
93
|
+
us: 16,
|
|
94
|
+
ns: 19,
|
|
95
95
|
};
|