@hpcc-js/comms 3.23.0 → 3.23.1
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/README.md +4 -4
- package/dist/browser/index.js +12 -12
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.cjs +2 -2
- package/dist/browser/index.umd.cjs.map +1 -1
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +12 -12
- package/dist/node/index.js.map +1 -1
- package/package.json +23 -23
- package/src/ecl/sql2.ts +11 -11
- package/src/services/wsSQL2.ts +1 -1
- package/src/services/wsdl/WsSQL2/current/WsSQL2.ts +15 -14
- package/src/services/wsdl/WsSQL2/v1.01/WsSQL2.ts +223 -0
- package/types/ecl/sql2.d.ts +1 -1
- package/types/services/wsSQL2.d.ts +1 -1
- package/types/services/wsdl/WsSQL2/{v1.00 → v1.01}/WsSQL2.d.ts +13 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/comms",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.1",
|
|
4
4
|
"description": "hpcc-js - Communications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/node/index.cjs",
|
|
@@ -53,27 +53,27 @@
|
|
|
53
53
|
"coverage": "vitest run --coverage",
|
|
54
54
|
"update": "npx --yes npm-check-updates -u -t minor",
|
|
55
55
|
"update-major": "npx --yes npm-check-updates -u",
|
|
56
|
-
"wsdl-access": "
|
|
57
|
-
"wsdl-account": "
|
|
58
|
-
"wsdl-cloud": "
|
|
59
|
-
"wsdl-codesign": "
|
|
60
|
-
"wsdl-dali": "
|
|
61
|
-
"wsdl-dfu": "
|
|
62
|
-
"wsdl-dfuxref": "
|
|
63
|
-
"wsdl-elk": "
|
|
64
|
-
"wsdl-esdlconfig": "
|
|
65
|
-
"wsdl-fileio": "
|
|
66
|
-
"wsdl-filespray": "
|
|
67
|
-
"wsdl-logaccess": "
|
|
68
|
-
"wsdl-machine": "
|
|
69
|
-
"wsdl-packageprocess": "
|
|
70
|
-
"wsdl-sasha": "
|
|
71
|
-
"wsdl-smc": "
|
|
72
|
-
"wsdl-sql2": "
|
|
73
|
-
"wsdl-resources": "
|
|
74
|
-
"wsdl-store": "
|
|
75
|
-
"wsdl-topology": "
|
|
76
|
-
"wsdl-workunits": "
|
|
56
|
+
"wsdl-access": "tsx ./utils/index.ts -k --url=http://localhost:8010/ws_access?wsdl --outDir=./src/services/wsdl",
|
|
57
|
+
"wsdl-account": "tsx ./utils/index.ts -k --url=http://localhost:8010/Ws_Account?wsdl --outDir=./src/services/wsdl",
|
|
58
|
+
"wsdl-cloud": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsCloud?wsdl --outDir=./src/services/wsdl",
|
|
59
|
+
"wsdl-codesign": "tsx ./utils/index.ts -k --url=http://localhost:8010/ws_codesign?wsdl --outDir=./src/services/wsdl",
|
|
60
|
+
"wsdl-dali": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsDali?wsdl --outDir=./src/services/wsdl",
|
|
61
|
+
"wsdl-dfu": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsDfu?wsdl --outDir=./src/services/wsdl",
|
|
62
|
+
"wsdl-dfuxref": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsDFUXRef?wsdl --outDir=./src/services/wsdl",
|
|
63
|
+
"wsdl-elk": "tsx ./utils/index.ts -k --url=http://localhost:8010/ws_elk?wsdl --outDir=./src/services/wsdl",
|
|
64
|
+
"wsdl-esdlconfig": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsEsdlconfig?wsdl --outDir=./src/services/wsdl",
|
|
65
|
+
"wsdl-fileio": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsFileIO?wsdl --outDir=./src/services/wsdl",
|
|
66
|
+
"wsdl-filespray": "tsx ./utils/index.ts -k --url=http://localhost:8010/FileSpray?wsdl --outDir=./src/services/wsdl",
|
|
67
|
+
"wsdl-logaccess": "tsx ./utils/index.ts -k --url=http://localhost:8010/ws_logaccess?wsdl --outDir=./src/services/wsdl",
|
|
68
|
+
"wsdl-machine": "tsx ./utils/index.ts -k --url=http://localhost:8010/ws_machine?wsdl --outDir=./src/services/wsdl",
|
|
69
|
+
"wsdl-packageprocess": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsPackageProcess?wsdl --outDir=./src/services/wsdl",
|
|
70
|
+
"wsdl-sasha": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsSasha?wsdl --outDir=./src/services/wsdl",
|
|
71
|
+
"wsdl-smc": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsSMC?wsdl --outDir=./src/services/wsdl",
|
|
72
|
+
"wsdl-sql2": "tsx ./utils/index.ts -k --url=http://localhost:8510/WsSQL2?wsdl --outDir=./src/services/wsdl",
|
|
73
|
+
"wsdl-resources": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsResources?wsdl --outDir=./src/services/wsdl",
|
|
74
|
+
"wsdl-store": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsStore?wsdl --outDir=./src/services/wsdl",
|
|
75
|
+
"wsdl-topology": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsTopology?wsdl --outDir=./src/services/wsdl",
|
|
76
|
+
"wsdl-workunits": "tsx ./utils/index.ts -k --url=http://localhost:8010/WsWorkunits?wsdl --outDir=./src/services/wsdl",
|
|
77
77
|
"wsdl-all": "npm-run-all --aggregate-output -c --serial build --parallel wsdl-*"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"esp",
|
|
113
113
|
"HPCC-Platform"
|
|
114
114
|
],
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "099b2ba95683821419933cbb439aca232371a2b1"
|
|
116
116
|
}
|
package/src/ecl/sql2.ts
CHANGED
|
@@ -16,13 +16,13 @@ function checkExceptions(response: { Exceptions?: WsSQL2.Exceptions }): void {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function rowsFrom(response: {
|
|
20
|
-
if (typeof response.
|
|
21
|
-
throw new Error("WsSQL2 response is missing
|
|
19
|
+
function rowsFrom(response: { RowsJSON?: string }): SQLValue[][] {
|
|
20
|
+
if (typeof response.RowsJSON !== "string") {
|
|
21
|
+
throw new Error("WsSQL2 response is missing RowsJSON");
|
|
22
22
|
}
|
|
23
23
|
let rows: unknown;
|
|
24
24
|
try {
|
|
25
|
-
rows = JSON.parse(response.
|
|
25
|
+
rows = JSON.parse(response.RowsJSON);
|
|
26
26
|
} catch (error) {
|
|
27
27
|
const message = error instanceof Error ? error.message : String(error);
|
|
28
28
|
throw Object.assign(new Error(`Error parsing WsSQL2 Rows JSON '${message}'`), { cause: error });
|
|
@@ -72,17 +72,17 @@ export class SQLConnection {
|
|
|
72
72
|
async explainQuery(sql: string): Promise<WsSQL2.ExplainQueryResponse> {
|
|
73
73
|
this.checkOpen();
|
|
74
74
|
if (!sql.trim()) throw new Error("SQL text is required");
|
|
75
|
-
const response = await this.service.ExplainQuery({
|
|
75
|
+
const response = await this.service.ExplainQuery({ SQLText: sql });
|
|
76
76
|
checkExceptions(response);
|
|
77
77
|
return response;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
async logicalFileMeta(logicalName: string): Promise<WsSQL2.
|
|
80
|
+
async logicalFileMeta(logicalName: string): Promise<WsSQL2.LogicalFileMetadata | undefined> {
|
|
81
81
|
this.checkOpen();
|
|
82
82
|
if (!logicalName.trim()) throw new Error("Logical file name is required");
|
|
83
|
-
const response = await this.service.
|
|
83
|
+
const response = await this.service.LogicalFileMetadata({ LogicalName: logicalName });
|
|
84
84
|
checkExceptions(response);
|
|
85
|
-
return response.
|
|
85
|
+
return response.LogicalFileMetadata;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
async ping(): Promise<boolean> {
|
|
@@ -94,7 +94,7 @@ export class SQLConnection {
|
|
|
94
94
|
async splitQuery(sql: string): Promise<string[]> {
|
|
95
95
|
this.checkOpen();
|
|
96
96
|
if (!sql.trim()) return [];
|
|
97
|
-
const response = await this.service.SplitQuery({
|
|
97
|
+
const response = await this.service.SplitQuery({ SQLText: sql });
|
|
98
98
|
checkExceptions(response);
|
|
99
99
|
const statements = response.Statements?.Statement ?? [];
|
|
100
100
|
if (!Array.isArray(statements) || !statements.every(statement => typeof statement === "string")) {
|
|
@@ -171,7 +171,7 @@ export class SQLStatement {
|
|
|
171
171
|
this.result = undefined;
|
|
172
172
|
if (this.closed) throw new Error("SQL statement is closed");
|
|
173
173
|
const response = await this.service.ExecuteQuery({
|
|
174
|
-
|
|
174
|
+
SQLText: sql, IncludeResultSetMetadata: true
|
|
175
175
|
});
|
|
176
176
|
const columns = response.ResultSetMetadata?.Column;
|
|
177
177
|
const result = response.CursorId ? new SQLResultSet(this.service, columns ?? [], response.CursorId, this.fetchSize) : undefined;
|
|
@@ -276,7 +276,7 @@ export class SQLResultSet {
|
|
|
276
276
|
while (++this.index >= this.rows.length) {
|
|
277
277
|
this.checkOpen();
|
|
278
278
|
if (this.complete) return false;
|
|
279
|
-
const response = await this.service.FetchResultSet({ CursorId: this.cursor,
|
|
279
|
+
const response = await this.service.FetchResultSet({ CursorId: this.cursor, RowCount: this.fetchSize });
|
|
280
280
|
checkExceptions(response);
|
|
281
281
|
if (typeof response.Complete !== "boolean") throw new Error("WsSQL2 fetch response is missing Complete");
|
|
282
282
|
const rows = rowsFrom(response);
|
package/src/services/wsSQL2.ts
CHANGED
|
@@ -30,7 +30,7 @@ export namespace WsSQL2 {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface ExecuteQueryRequest {
|
|
33
|
-
|
|
33
|
+
SQLText?: string;
|
|
34
34
|
IncludeRuntimeGraph?: boolean;
|
|
35
35
|
IncludeResultSetMetadata?: boolean;
|
|
36
36
|
IncludeDebug?: boolean;
|
|
@@ -56,19 +56,19 @@ export namespace WsSQL2 {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export interface ExplainQueryRequest {
|
|
59
|
-
|
|
59
|
+
SQLText?: string;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
export interface ExplainQueryResponse {
|
|
63
63
|
Exceptions?: Exceptions;
|
|
64
64
|
Plan?: string;
|
|
65
|
-
|
|
65
|
+
PlanJSON?: string;
|
|
66
66
|
ResultSetMetadata?: ResultSetMetadata;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export interface FetchResultSetRequest {
|
|
70
70
|
CursorId?: string;
|
|
71
|
-
|
|
71
|
+
RowCount?: unsignedInt;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
export interface Start {
|
|
@@ -128,19 +128,20 @@ export namespace WsSQL2 {
|
|
|
128
128
|
|
|
129
129
|
export interface FetchResultSetResponse {
|
|
130
130
|
Exceptions?: Exceptions;
|
|
131
|
-
|
|
131
|
+
RowsJSON?: string;
|
|
132
|
+
RowCount?: unsignedInt;
|
|
132
133
|
Complete?: boolean;
|
|
133
134
|
ExecuteMs?: double;
|
|
134
135
|
RuntimeGraph?: string;
|
|
135
|
-
|
|
136
|
+
RuntimeGraphJSON?: string;
|
|
136
137
|
DebugInfo?: DebugInfo;
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
export interface
|
|
140
|
+
export interface LogicalFileMetadataRequest {
|
|
140
141
|
LogicalName?: string;
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
export interface
|
|
144
|
+
export interface LogicalFileMetadata {
|
|
144
145
|
Version?: unsignedInt;
|
|
145
146
|
LogicalName?: string;
|
|
146
147
|
Kind?: string;
|
|
@@ -157,9 +158,9 @@ export namespace WsSQL2 {
|
|
|
157
158
|
SampleSQL?: string;
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
export interface
|
|
161
|
+
export interface LogicalFileMetadataResponse {
|
|
161
162
|
Exceptions?: Exceptions;
|
|
162
|
-
|
|
163
|
+
LogicalFileMetadata?: LogicalFileMetadata;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
export interface WsSQL2PingRequest {
|
|
@@ -171,7 +172,7 @@ export namespace WsSQL2 {
|
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
export interface SplitQueryRequest {
|
|
174
|
-
|
|
175
|
+
SQLText?: string;
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
export interface Statements {
|
|
@@ -188,7 +189,7 @@ export namespace WsSQL2 {
|
|
|
188
189
|
export class SQL2ServiceBase extends Service {
|
|
189
190
|
|
|
190
191
|
constructor(optsConnection: IOptions | IConnection) {
|
|
191
|
-
super(optsConnection, "WsSQL2", "1.
|
|
192
|
+
super(optsConnection, "WsSQL2", "1.01");
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
CloseResultSet(request: WsSQL2.CloseResultSetRequest, abortSignal?: AbortSignal): Promise<WsSQL2.CloseResultSetResponse> {
|
|
@@ -207,8 +208,8 @@ export class SQL2ServiceBase extends Service {
|
|
|
207
208
|
return this._connection.send("FetchResultSet", request, "json", false, abortSignal, "FetchResultSetResponse");
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
return this._connection.send("
|
|
211
|
+
LogicalFileMetadata(request: WsSQL2.LogicalFileMetadataRequest, abortSignal?: AbortSignal): Promise<WsSQL2.LogicalFileMetadataResponse> {
|
|
212
|
+
return this._connection.send("LogicalFileMetadata", request, "json", false, abortSignal, "LogicalFileMetadataResponse");
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
Ping(request: WsSQL2.WsSQL2PingRequest, abortSignal?: AbortSignal): Promise<WsSQL2.WsSQL2PingResponse> {
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { IConnection, IOptions } from "../../../../connection.ts";
|
|
2
|
+
import { Service } from "../../../../espConnection.ts";
|
|
3
|
+
|
|
4
|
+
export namespace WsSQL2 {
|
|
5
|
+
|
|
6
|
+
export type double = number;
|
|
7
|
+
export type unsignedInt = number;
|
|
8
|
+
export type long = number;
|
|
9
|
+
export type uint64 = number;
|
|
10
|
+
|
|
11
|
+
export interface CloseResultSetRequest {
|
|
12
|
+
CursorId?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Exception {
|
|
16
|
+
Code?: string;
|
|
17
|
+
Audience?: string;
|
|
18
|
+
Source?: string;
|
|
19
|
+
Message?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface Exceptions {
|
|
23
|
+
Source?: string;
|
|
24
|
+
Exception?: Exception[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface CloseResultSetResponse {
|
|
28
|
+
Exceptions?: Exceptions;
|
|
29
|
+
Closed?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ExecuteQueryRequest {
|
|
33
|
+
SQLText?: string;
|
|
34
|
+
IncludeRuntimeGraph?: boolean;
|
|
35
|
+
IncludeResultSetMetadata?: boolean;
|
|
36
|
+
IncludeDebug?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Column {
|
|
40
|
+
ColumnLabel?: string;
|
|
41
|
+
ColumnTypeName?: string;
|
|
42
|
+
Precision?: unsignedInt;
|
|
43
|
+
Scale?: unsignedInt;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ResultSetMetadata {
|
|
47
|
+
Column?: Column[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ExecuteQueryResponse {
|
|
51
|
+
Exceptions?: Exceptions;
|
|
52
|
+
CursorId?: string;
|
|
53
|
+
InitMs?: double;
|
|
54
|
+
PrepareMs?: double;
|
|
55
|
+
ResultSetMetadata?: ResultSetMetadata;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ExplainQueryRequest {
|
|
59
|
+
SQLText?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ExplainQueryResponse {
|
|
63
|
+
Exceptions?: Exceptions;
|
|
64
|
+
Plan?: string;
|
|
65
|
+
PlanJSON?: string;
|
|
66
|
+
ResultSetMetadata?: ResultSetMetadata;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface FetchResultSetRequest {
|
|
70
|
+
CursorId?: string;
|
|
71
|
+
RowCount?: unsignedInt;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface Start {
|
|
75
|
+
DuckDBUsedBytes?: long;
|
|
76
|
+
DuckDBTempBytes?: long;
|
|
77
|
+
HeapInUseBytes?: long;
|
|
78
|
+
ResidentBytes?: long;
|
|
79
|
+
PeakResidentBytes?: long;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface Current {
|
|
83
|
+
DuckDBUsedBytes?: long;
|
|
84
|
+
DuckDBTempBytes?: long;
|
|
85
|
+
HeapInUseBytes?: long;
|
|
86
|
+
ResidentBytes?: long;
|
|
87
|
+
PeakResidentBytes?: long;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface Released {
|
|
91
|
+
DuckDBUsedBytes?: long;
|
|
92
|
+
DuckDBTempBytes?: long;
|
|
93
|
+
HeapInUseBytes?: long;
|
|
94
|
+
ResidentBytes?: long;
|
|
95
|
+
PeakResidentBytes?: long;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface Retained {
|
|
99
|
+
DuckDBUsedBytes?: long;
|
|
100
|
+
DuckDBTempBytes?: long;
|
|
101
|
+
HeapInUseBytes?: long;
|
|
102
|
+
ResidentBytes?: long;
|
|
103
|
+
PeakResidentBytes?: long;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface ScanObjectsCreated {
|
|
107
|
+
BindData?: long;
|
|
108
|
+
GlobalStates?: long;
|
|
109
|
+
LocalStates?: long;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ScanObjectsLive {
|
|
113
|
+
BindData?: long;
|
|
114
|
+
GlobalStates?: long;
|
|
115
|
+
LocalStates?: long;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface DebugInfo {
|
|
119
|
+
Start?: Start;
|
|
120
|
+
Current?: Current;
|
|
121
|
+
Released?: Released;
|
|
122
|
+
Retained?: Retained;
|
|
123
|
+
ScanObjectsCreated?: ScanObjectsCreated;
|
|
124
|
+
ScanObjectsLive?: ScanObjectsLive;
|
|
125
|
+
LeakCheck?: string;
|
|
126
|
+
LeakCheckDetail?: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface FetchResultSetResponse {
|
|
130
|
+
Exceptions?: Exceptions;
|
|
131
|
+
RowsJSON?: string;
|
|
132
|
+
RowCount?: unsignedInt;
|
|
133
|
+
Complete?: boolean;
|
|
134
|
+
ExecuteMs?: double;
|
|
135
|
+
RuntimeGraph?: string;
|
|
136
|
+
RuntimeGraphJSON?: string;
|
|
137
|
+
DebugInfo?: DebugInfo;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface LogicalFileMetadataRequest {
|
|
141
|
+
LogicalName?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface LogicalFileMetadata {
|
|
145
|
+
Version?: unsignedInt;
|
|
146
|
+
LogicalName?: string;
|
|
147
|
+
Kind?: string;
|
|
148
|
+
Format?: string;
|
|
149
|
+
Grouped?: boolean;
|
|
150
|
+
FormatCrc?: unsignedInt;
|
|
151
|
+
RecordTranslationMode?: unsignedInt;
|
|
152
|
+
Modified?: long;
|
|
153
|
+
RecordCount?: uint64;
|
|
154
|
+
FormatOptions?: string;
|
|
155
|
+
ProviderOptions?: string;
|
|
156
|
+
EclRecord?: string;
|
|
157
|
+
FileParts?: string;
|
|
158
|
+
SampleSQL?: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface LogicalFileMetadataResponse {
|
|
162
|
+
Exceptions?: Exceptions;
|
|
163
|
+
LogicalFileMetadata?: LogicalFileMetadata;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface WsSQL2PingRequest {
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface WsSQL2PingResponse {
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface SplitQueryRequest {
|
|
175
|
+
SQLText?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface Statements {
|
|
179
|
+
Statement?: string[];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface SplitQueryResponse {
|
|
183
|
+
Exceptions?: Exceptions;
|
|
184
|
+
Statements?: Statements;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export class SQL2ServiceBase extends Service {
|
|
190
|
+
|
|
191
|
+
constructor(optsConnection: IOptions | IConnection) {
|
|
192
|
+
super(optsConnection, "WsSQL2", "1.01");
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
CloseResultSet(request: WsSQL2.CloseResultSetRequest, abortSignal?: AbortSignal): Promise<WsSQL2.CloseResultSetResponse> {
|
|
196
|
+
return this._connection.send("CloseResultSet", request, "json", false, abortSignal, "CloseResultSetResponse");
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
ExecuteQuery(request: WsSQL2.ExecuteQueryRequest, abortSignal?: AbortSignal): Promise<WsSQL2.ExecuteQueryResponse> {
|
|
200
|
+
return this._connection.send("ExecuteQuery", request, "json", false, abortSignal, "ExecuteQueryResponse");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
ExplainQuery(request: WsSQL2.ExplainQueryRequest, abortSignal?: AbortSignal): Promise<WsSQL2.ExplainQueryResponse> {
|
|
204
|
+
return this._connection.send("ExplainQuery", request, "json", false, abortSignal, "ExplainQueryResponse");
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
FetchResultSet(request: WsSQL2.FetchResultSetRequest, abortSignal?: AbortSignal): Promise<WsSQL2.FetchResultSetResponse> {
|
|
208
|
+
return this._connection.send("FetchResultSet", request, "json", false, abortSignal, "FetchResultSetResponse");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
LogicalFileMetadata(request: WsSQL2.LogicalFileMetadataRequest, abortSignal?: AbortSignal): Promise<WsSQL2.LogicalFileMetadataResponse> {
|
|
212
|
+
return this._connection.send("LogicalFileMetadata", request, "json", false, abortSignal, "LogicalFileMetadataResponse");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
Ping(request: WsSQL2.WsSQL2PingRequest, abortSignal?: AbortSignal): Promise<WsSQL2.WsSQL2PingResponse> {
|
|
216
|
+
return this._connection.send("Ping", request, "json", false, abortSignal, "WsSQL2PingResponse");
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
SplitQuery(request: WsSQL2.SplitQueryRequest, abortSignal?: AbortSignal): Promise<WsSQL2.SplitQueryResponse> {
|
|
220
|
+
return this._connection.send("SplitQuery", request, "json", false, abortSignal, "SplitQueryResponse");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
}
|
package/types/ecl/sql2.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare class SQLConnection {
|
|
|
18
18
|
createStatement(): SQLStatement;
|
|
19
19
|
queryRows(sql: string, fetchSize?: number): Promise<SQLRow[]>;
|
|
20
20
|
explainQuery(sql: string): Promise<WsSQL2.ExplainQueryResponse>;
|
|
21
|
-
logicalFileMeta(logicalName: string): Promise<WsSQL2.
|
|
21
|
+
logicalFileMeta(logicalName: string): Promise<WsSQL2.LogicalFileMetadata | undefined>;
|
|
22
22
|
ping(): Promise<boolean>;
|
|
23
23
|
splitQuery(sql: string): Promise<string[]>;
|
|
24
24
|
close(): Promise<void>;
|
|
@@ -23,7 +23,7 @@ export declare namespace WsSQL2 {
|
|
|
23
23
|
Closed?: boolean;
|
|
24
24
|
}
|
|
25
25
|
interface ExecuteQueryRequest {
|
|
26
|
-
|
|
26
|
+
SQLText?: string;
|
|
27
27
|
IncludeRuntimeGraph?: boolean;
|
|
28
28
|
IncludeResultSetMetadata?: boolean;
|
|
29
29
|
IncludeDebug?: boolean;
|
|
@@ -45,17 +45,17 @@ export declare namespace WsSQL2 {
|
|
|
45
45
|
ResultSetMetadata?: ResultSetMetadata;
|
|
46
46
|
}
|
|
47
47
|
interface ExplainQueryRequest {
|
|
48
|
-
|
|
48
|
+
SQLText?: string;
|
|
49
49
|
}
|
|
50
50
|
interface ExplainQueryResponse {
|
|
51
51
|
Exceptions?: Exceptions;
|
|
52
52
|
Plan?: string;
|
|
53
|
-
|
|
53
|
+
PlanJSON?: string;
|
|
54
54
|
ResultSetMetadata?: ResultSetMetadata;
|
|
55
55
|
}
|
|
56
56
|
interface FetchResultSetRequest {
|
|
57
57
|
CursorId?: string;
|
|
58
|
-
|
|
58
|
+
RowCount?: unsignedInt;
|
|
59
59
|
}
|
|
60
60
|
interface Start {
|
|
61
61
|
DuckDBUsedBytes?: long;
|
|
@@ -107,17 +107,18 @@ export declare namespace WsSQL2 {
|
|
|
107
107
|
}
|
|
108
108
|
interface FetchResultSetResponse {
|
|
109
109
|
Exceptions?: Exceptions;
|
|
110
|
-
|
|
110
|
+
RowsJSON?: string;
|
|
111
|
+
RowCount?: unsignedInt;
|
|
111
112
|
Complete?: boolean;
|
|
112
113
|
ExecuteMs?: double;
|
|
113
114
|
RuntimeGraph?: string;
|
|
114
|
-
|
|
115
|
+
RuntimeGraphJSON?: string;
|
|
115
116
|
DebugInfo?: DebugInfo;
|
|
116
117
|
}
|
|
117
|
-
interface
|
|
118
|
+
interface LogicalFileMetadataRequest {
|
|
118
119
|
LogicalName?: string;
|
|
119
120
|
}
|
|
120
|
-
interface
|
|
121
|
+
interface LogicalFileMetadata {
|
|
121
122
|
Version?: unsignedInt;
|
|
122
123
|
LogicalName?: string;
|
|
123
124
|
Kind?: string;
|
|
@@ -133,16 +134,16 @@ export declare namespace WsSQL2 {
|
|
|
133
134
|
FileParts?: string;
|
|
134
135
|
SampleSQL?: string;
|
|
135
136
|
}
|
|
136
|
-
interface
|
|
137
|
+
interface LogicalFileMetadataResponse {
|
|
137
138
|
Exceptions?: Exceptions;
|
|
138
|
-
|
|
139
|
+
LogicalFileMetadata?: LogicalFileMetadata;
|
|
139
140
|
}
|
|
140
141
|
interface WsSQL2PingRequest {
|
|
141
142
|
}
|
|
142
143
|
interface WsSQL2PingResponse {
|
|
143
144
|
}
|
|
144
145
|
interface SplitQueryRequest {
|
|
145
|
-
|
|
146
|
+
SQLText?: string;
|
|
146
147
|
}
|
|
147
148
|
interface Statements {
|
|
148
149
|
Statement?: string[];
|
|
@@ -158,7 +159,7 @@ export declare class SQL2ServiceBase extends Service {
|
|
|
158
159
|
ExecuteQuery(request: WsSQL2.ExecuteQueryRequest, abortSignal?: AbortSignal): Promise<WsSQL2.ExecuteQueryResponse>;
|
|
159
160
|
ExplainQuery(request: WsSQL2.ExplainQueryRequest, abortSignal?: AbortSignal): Promise<WsSQL2.ExplainQueryResponse>;
|
|
160
161
|
FetchResultSet(request: WsSQL2.FetchResultSetRequest, abortSignal?: AbortSignal): Promise<WsSQL2.FetchResultSetResponse>;
|
|
161
|
-
|
|
162
|
+
LogicalFileMetadata(request: WsSQL2.LogicalFileMetadataRequest, abortSignal?: AbortSignal): Promise<WsSQL2.LogicalFileMetadataResponse>;
|
|
162
163
|
Ping(request: WsSQL2.WsSQL2PingRequest, abortSignal?: AbortSignal): Promise<WsSQL2.WsSQL2PingResponse>;
|
|
163
164
|
SplitQuery(request: WsSQL2.SplitQueryRequest, abortSignal?: AbortSignal): Promise<WsSQL2.SplitQueryResponse>;
|
|
164
165
|
}
|