@databricks/sql 1.4.0 → 1.6.0
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 +1 -1
- package/dist/DBSQLClient.d.ts +15 -8
- package/dist/DBSQLClient.js +76 -81
- package/dist/DBSQLClient.js.map +1 -1
- package/dist/DBSQLOperation/FetchResultsHelper.d.ts +3 -3
- package/dist/DBSQLOperation/FetchResultsHelper.js +4 -3
- package/dist/DBSQLOperation/FetchResultsHelper.js.map +1 -1
- package/dist/DBSQLOperation/index.d.ts +19 -10
- package/dist/DBSQLOperation/index.js +178 -47
- package/dist/DBSQLOperation/index.js.map +1 -1
- package/dist/DBSQLParameter.d.ts +33 -0
- package/dist/DBSQLParameter.js +87 -0
- package/dist/DBSQLParameter.js.map +1 -0
- package/dist/DBSQLSession.d.ts +10 -7
- package/dist/DBSQLSession.js +188 -23
- package/dist/DBSQLSession.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.d.ts +3 -3
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js +3 -4
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.d.ts +11 -3
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js +74 -20
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/index.d.ts +4 -6
- package/dist/connection/auth/DatabricksOAuth/index.js +1 -1
- package/dist/connection/auth/DatabricksOAuth/index.js.map +1 -1
- package/dist/connection/auth/PlainHttpAuthentication.d.ts +6 -3
- package/dist/connection/auth/PlainHttpAuthentication.js +1 -0
- package/dist/connection/auth/PlainHttpAuthentication.js.map +1 -1
- package/dist/connection/connections/HttpConnection.d.ts +16 -9
- package/dist/connection/connections/HttpConnection.js +60 -51
- package/dist/connection/connections/HttpConnection.js.map +1 -1
- package/dist/connection/connections/ThriftHttpConnection.d.ts +38 -0
- package/dist/connection/connections/ThriftHttpConnection.js +134 -0
- package/dist/connection/connections/ThriftHttpConnection.js.map +1 -0
- package/dist/connection/contracts/IAuthentication.d.ts +2 -2
- package/dist/connection/contracts/IConnectionOptions.d.ts +17 -19
- package/dist/connection/contracts/IConnectionProvider.d.ts +6 -3
- package/dist/contracts/IClientContext.d.ts +10 -0
- package/dist/{connection/contracts/IThriftConnection.js → contracts/IClientContext.js} +1 -1
- package/dist/contracts/IClientContext.js.map +1 -0
- package/dist/contracts/IDBSQLClient.d.ts +4 -0
- package/dist/contracts/IDBSQLSession.d.ts +34 -0
- package/dist/contracts/IDriver.d.ts +24 -0
- package/dist/contracts/IDriver.js +3 -0
- package/dist/contracts/IDriver.js.map +1 -0
- package/dist/errors/OperationStateError.js +2 -1
- package/dist/errors/OperationStateError.js.map +1 -1
- package/dist/errors/ParameterError.d.ts +2 -0
- package/dist/errors/ParameterError.js +6 -0
- package/dist/errors/ParameterError.js.map +1 -0
- package/dist/errors/StagingError.d.ts +2 -0
- package/dist/errors/StagingError.js +6 -0
- package/dist/errors/StagingError.js.map +1 -0
- package/dist/hive/HiveDriver.d.ts +8 -5
- package/dist/hive/HiveDriver.js +23 -23
- package/dist/hive/HiveDriver.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/result/ArrowResult.d.ts +3 -1
- package/dist/result/ArrowResult.js +6 -4
- package/dist/result/ArrowResult.js.map +1 -1
- package/dist/result/CloudFetchResult.d.ts +2 -1
- package/dist/result/CloudFetchResult.js +5 -3
- package/dist/result/CloudFetchResult.js.map +1 -1
- package/dist/result/JsonResult.d.ts +3 -1
- package/dist/result/JsonResult.js +2 -1
- package/dist/result/JsonResult.js.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +1 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -5
- package/thrift/TCLIService.d.ts +2 -1
- package/thrift/TCLIService.js +1 -1
- package/thrift/TCLIService_types.d.ts +11 -3
- package/thrift/TCLIService_types.js +41 -4
- package/dist/DBSQLOperation/CompleteOperationHelper.d.ts +0 -13
- package/dist/DBSQLOperation/CompleteOperationHelper.js +0 -56
- package/dist/DBSQLOperation/CompleteOperationHelper.js.map +0 -1
- package/dist/DBSQLOperation/OperationStatusHelper.d.ts +0 -16
- package/dist/DBSQLOperation/OperationStatusHelper.js +0 -138
- package/dist/DBSQLOperation/OperationStatusHelper.js.map +0 -1
- package/dist/DBSQLOperation/SchemaHelper.d.ts +0 -13
- package/dist/DBSQLOperation/SchemaHelper.js +0 -74
- package/dist/DBSQLOperation/SchemaHelper.js.map +0 -1
- package/dist/connection/contracts/IThriftConnection.d.ts +0 -4
- package/dist/connection/contracts/IThriftConnection.js.map +0 -1
- package/dist/node_modules/thrift/LICENSE +0 -306
- package/dist/node_modules/thrift/README.md +0 -210
- package/dist/node_modules/thrift/lib/nodejs/README.md +0 -142
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/binary.js +0 -168
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/binary_protocol.js +0 -367
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/browser.js +0 -49
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/buffered_transport.js +0 -186
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/compact_protocol.js +0 -915
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/connection.js +0 -396
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/create_client.js +0 -54
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/framed_transport.js +0 -185
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/header_protocol.js +0 -258
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/header_transport.js +0 -341
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js +0 -292
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/index.js +0 -76
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/input_buffer_underrun_error.js +0 -32
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/int64_util.js +0 -91
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/json_parse.js +0 -299
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/json_protocol.js +0 -799
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/log.js +0 -87
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_processor.js +0 -63
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_protocol.js +0 -73
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/protocol.js +0 -22
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/server.js +0 -123
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/thrift.js +0 -241
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/transport.js +0 -22
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/web_server.js +0 -567
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/ws_connection.js +0 -286
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/ws_transport.js +0 -206
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/xhr_connection.js +0 -280
- package/dist/node_modules/thrift/package.json +0 -72
- package/dist/utils/areHeadersEqual.d.ts +0 -2
- package/dist/utils/areHeadersEqual.js +0 -49
- package/dist/utils/areHeadersEqual.js.map +0 -1
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Imported from Douglas Crockford's reference implementation with minimum modification
|
|
3
|
-
* to handle Int64.
|
|
4
|
-
*
|
|
5
|
-
* https://github.com/douglascrockford/JSON-js/blob/c98948ae1944a28e2e8ebc3717894e580aeaaa05/json_parse.js
|
|
6
|
-
*
|
|
7
|
-
* Original license header:
|
|
8
|
-
*
|
|
9
|
-
* json_parse.js
|
|
10
|
-
* 2015-05-02
|
|
11
|
-
* Public Domain.
|
|
12
|
-
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/*jslint for */
|
|
17
|
-
|
|
18
|
-
/*property
|
|
19
|
-
at, b, call, charAt, f, fromCharCode, hasOwnProperty, message, n, name,
|
|
20
|
-
prototype, push, r, t, text
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
var Int64 = require('node-int64');
|
|
24
|
-
var Int64Util = require('./int64_util');
|
|
25
|
-
|
|
26
|
-
var json_parse = module.exports = (function () {
|
|
27
|
-
"use strict";
|
|
28
|
-
|
|
29
|
-
// This is a function that can parse a JSON text, producing a JavaScript
|
|
30
|
-
// data structure. It is a simple, recursive descent parser. It does not use
|
|
31
|
-
// eval or regular expressions, so it can be used as a model for implementing
|
|
32
|
-
// a JSON parser in other languages.
|
|
33
|
-
|
|
34
|
-
// We are defining the function inside of another function to avoid creating
|
|
35
|
-
// global variables.
|
|
36
|
-
|
|
37
|
-
var at, // The index of the current character
|
|
38
|
-
ch, // The current character
|
|
39
|
-
escapee = {
|
|
40
|
-
'"': '"',
|
|
41
|
-
'\\': '\\',
|
|
42
|
-
'/': '/',
|
|
43
|
-
b: '\b',
|
|
44
|
-
f: '\f',
|
|
45
|
-
n: '\n',
|
|
46
|
-
r: '\r',
|
|
47
|
-
t: '\t'
|
|
48
|
-
},
|
|
49
|
-
text,
|
|
50
|
-
|
|
51
|
-
error = function (m) {
|
|
52
|
-
|
|
53
|
-
// Call error when something is wrong.
|
|
54
|
-
|
|
55
|
-
throw new SyntaxError(m);
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
next = function (c) {
|
|
59
|
-
|
|
60
|
-
// If a c parameter is provided, verify that it matches the current character.
|
|
61
|
-
|
|
62
|
-
if (c && c !== ch) {
|
|
63
|
-
error("Expected '" + c + "' instead of '" + ch + "'");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Get the next character. When there are no more characters,
|
|
67
|
-
// return the empty string.
|
|
68
|
-
|
|
69
|
-
ch = text.charAt(at);
|
|
70
|
-
at += 1;
|
|
71
|
-
return ch;
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
number = function () {
|
|
75
|
-
|
|
76
|
-
// Parse a number value.
|
|
77
|
-
|
|
78
|
-
var number,
|
|
79
|
-
string = '';
|
|
80
|
-
|
|
81
|
-
if (ch === '-') {
|
|
82
|
-
string = '-';
|
|
83
|
-
next('-');
|
|
84
|
-
}
|
|
85
|
-
while (ch >= '0' && ch <= '9') {
|
|
86
|
-
string += ch;
|
|
87
|
-
next();
|
|
88
|
-
}
|
|
89
|
-
if (ch === '.') {
|
|
90
|
-
string += '.';
|
|
91
|
-
while (next() && ch >= '0' && ch <= '9') {
|
|
92
|
-
string += ch;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (ch === 'e' || ch === 'E') {
|
|
96
|
-
string += ch;
|
|
97
|
-
next();
|
|
98
|
-
if (ch === '-' || ch === '+') {
|
|
99
|
-
string += ch;
|
|
100
|
-
next();
|
|
101
|
-
}
|
|
102
|
-
while (ch >= '0' && ch <= '9') {
|
|
103
|
-
string += ch;
|
|
104
|
-
next();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
number = +string;
|
|
108
|
-
if (!isFinite(number)) {
|
|
109
|
-
error("Bad number");
|
|
110
|
-
} else if (number >= Int64.MAX_INT || number <= Int64.MIN_INT) {
|
|
111
|
-
// Return raw string for further process in TJSONProtocol
|
|
112
|
-
return string;
|
|
113
|
-
} else {
|
|
114
|
-
return number;
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
string = function () {
|
|
119
|
-
|
|
120
|
-
// Parse a string value.
|
|
121
|
-
|
|
122
|
-
var hex,
|
|
123
|
-
i,
|
|
124
|
-
string = '',
|
|
125
|
-
uffff;
|
|
126
|
-
|
|
127
|
-
// When parsing for string values, we must look for " and \ characters.
|
|
128
|
-
|
|
129
|
-
if (ch === '"') {
|
|
130
|
-
while (next()) {
|
|
131
|
-
if (ch === '"') {
|
|
132
|
-
next();
|
|
133
|
-
return string;
|
|
134
|
-
}
|
|
135
|
-
if (ch === '\\') {
|
|
136
|
-
next();
|
|
137
|
-
if (ch === 'u') {
|
|
138
|
-
uffff = 0;
|
|
139
|
-
for (i = 0; i < 4; i += 1) {
|
|
140
|
-
hex = parseInt(next(), 16);
|
|
141
|
-
if (!isFinite(hex)) {
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
uffff = uffff * 16 + hex;
|
|
145
|
-
}
|
|
146
|
-
string += String.fromCharCode(uffff);
|
|
147
|
-
} else if (typeof escapee[ch] === 'string') {
|
|
148
|
-
string += escapee[ch];
|
|
149
|
-
} else {
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
} else {
|
|
153
|
-
string += ch;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
error("Bad string");
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
white = function () {
|
|
161
|
-
|
|
162
|
-
// Skip whitespace.
|
|
163
|
-
|
|
164
|
-
while (ch && ch <= ' ') {
|
|
165
|
-
next();
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
word = function () {
|
|
170
|
-
|
|
171
|
-
// true, false, or null.
|
|
172
|
-
|
|
173
|
-
switch (ch) {
|
|
174
|
-
case 't':
|
|
175
|
-
next('t');
|
|
176
|
-
next('r');
|
|
177
|
-
next('u');
|
|
178
|
-
next('e');
|
|
179
|
-
return true;
|
|
180
|
-
case 'f':
|
|
181
|
-
next('f');
|
|
182
|
-
next('a');
|
|
183
|
-
next('l');
|
|
184
|
-
next('s');
|
|
185
|
-
next('e');
|
|
186
|
-
return false;
|
|
187
|
-
case 'n':
|
|
188
|
-
next('n');
|
|
189
|
-
next('u');
|
|
190
|
-
next('l');
|
|
191
|
-
next('l');
|
|
192
|
-
return null;
|
|
193
|
-
}
|
|
194
|
-
error("Unexpected '" + ch + "'");
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
value, // Place holder for the value function.
|
|
198
|
-
|
|
199
|
-
array = function () {
|
|
200
|
-
|
|
201
|
-
// Parse an array value.
|
|
202
|
-
|
|
203
|
-
var array = [];
|
|
204
|
-
|
|
205
|
-
if (ch === '[') {
|
|
206
|
-
next('[');
|
|
207
|
-
white();
|
|
208
|
-
if (ch === ']') {
|
|
209
|
-
next(']');
|
|
210
|
-
return array; // empty array
|
|
211
|
-
}
|
|
212
|
-
while (ch) {
|
|
213
|
-
array.push(value());
|
|
214
|
-
white();
|
|
215
|
-
if (ch === ']') {
|
|
216
|
-
next(']');
|
|
217
|
-
return array;
|
|
218
|
-
}
|
|
219
|
-
next(',');
|
|
220
|
-
white();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
error("Bad array");
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
object = function () {
|
|
227
|
-
|
|
228
|
-
// Parse an object value.
|
|
229
|
-
|
|
230
|
-
var key,
|
|
231
|
-
object = {};
|
|
232
|
-
|
|
233
|
-
if (ch === '{') {
|
|
234
|
-
next('{');
|
|
235
|
-
white();
|
|
236
|
-
if (ch === '}') {
|
|
237
|
-
next('}');
|
|
238
|
-
return object; // empty object
|
|
239
|
-
}
|
|
240
|
-
while (ch) {
|
|
241
|
-
key = string();
|
|
242
|
-
white();
|
|
243
|
-
next(':');
|
|
244
|
-
if (Object.hasOwnProperty.call(object, key)) {
|
|
245
|
-
error('Duplicate key "' + key + '"');
|
|
246
|
-
}
|
|
247
|
-
object[key] = value();
|
|
248
|
-
white();
|
|
249
|
-
if (ch === '}') {
|
|
250
|
-
next('}');
|
|
251
|
-
return object;
|
|
252
|
-
}
|
|
253
|
-
next(',');
|
|
254
|
-
white();
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
error("Bad object");
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
value = function () {
|
|
261
|
-
|
|
262
|
-
// Parse a JSON value. It could be an object, an array, a string, a number,
|
|
263
|
-
// or a word.
|
|
264
|
-
|
|
265
|
-
white();
|
|
266
|
-
switch (ch) {
|
|
267
|
-
case '{':
|
|
268
|
-
return object();
|
|
269
|
-
case '[':
|
|
270
|
-
return array();
|
|
271
|
-
case '"':
|
|
272
|
-
return string();
|
|
273
|
-
case '-':
|
|
274
|
-
return number();
|
|
275
|
-
default:
|
|
276
|
-
return ch >= '0' && ch <= '9'
|
|
277
|
-
? number()
|
|
278
|
-
: word();
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
// Return the json_parse function. It will have access to all of the above
|
|
283
|
-
// functions and variables.
|
|
284
|
-
|
|
285
|
-
return function (source) {
|
|
286
|
-
var result;
|
|
287
|
-
|
|
288
|
-
text = source;
|
|
289
|
-
at = 0;
|
|
290
|
-
ch = ' ';
|
|
291
|
-
result = value();
|
|
292
|
-
white();
|
|
293
|
-
if (ch) {
|
|
294
|
-
error("Syntax error");
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return result;
|
|
298
|
-
};
|
|
299
|
-
}());
|