rqlite-js 2.5.5 → 2.5.7
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/es6/api/data/index.js +6 -0
- package/es6/http-request/index.js +39 -7
- package/es6/index.js +6 -0
- package/jsconfig.json +2 -1
- package/lib/api/backup/index.js +18 -17
- package/lib/api/backup/index.js.map +1 -1
- package/lib/api/client/index.js +10 -9
- package/lib/api/client/index.js.map +1 -1
- package/lib/api/data/index.js +24 -17
- package/lib/api/data/index.js.map +1 -1
- package/lib/api/results/data-result-error.js +2 -1
- package/lib/api/results/data-result-error.js.map +1 -1
- package/lib/api/results/data-result.js +42 -41
- package/lib/api/results/data-result.js.map +1 -1
- package/lib/api/results/data-results.js +20 -19
- package/lib/api/results/data-results.js.map +1 -1
- package/lib/api/results/index.js.map +1 -1
- package/lib/api/status/index.js +9 -8
- package/lib/api/status/index.js.map +1 -1
- package/lib/http-request/content-types.js +4 -4
- package/lib/http-request/content-types.js.map +1 -1
- package/lib/http-request/errors.js +2 -1
- package/lib/http-request/errors.js.map +1 -1
- package/lib/http-request/http-methods.js +13 -13
- package/lib/http-request/http-methods.js.map +1 -1
- package/lib/http-request/index.js +160 -127
- package/lib/http-request/index.js.map +1 -1
- package/lib/http-request/retryable.js +9 -8
- package/lib/http-request/retryable.js.map +1 -1
- package/lib/index.js +10 -3
- package/lib/index.js.map +1 -1
- package/package.json +21 -19
package/es6/api/data/index.js
CHANGED
|
@@ -28,6 +28,12 @@ export const CONSISTENCY_LEVEL_NONE = 'none'
|
|
|
28
28
|
*/
|
|
29
29
|
export const CONSISTENCY_LEVEL_STRONG = 'strong'
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Read query consistency linearizable which must come from
|
|
33
|
+
* the master node
|
|
34
|
+
*/
|
|
35
|
+
export const CONSISTENCY_LEVEL_LINEARIZABLE = 'linearizable'
|
|
36
|
+
|
|
31
37
|
/**
|
|
32
38
|
* Read query consistency weak which must come from
|
|
33
39
|
* the master node
|
|
@@ -89,14 +89,14 @@ function cleanPath (path) {
|
|
|
89
89
|
* backoff algorithm.
|
|
90
90
|
* @param {Number} attempt The retry attempt
|
|
91
91
|
* @param {Number} base The base of the exponential backoff
|
|
92
|
-
* @param {Number}
|
|
92
|
+
* @param {Number} exponent The exponential power
|
|
93
93
|
* @returns {Number} The time to wait in milliseconds
|
|
94
94
|
*/
|
|
95
|
-
export function getWaitTimeExponential (attempt = 0, base = 100,
|
|
95
|
+
export function getWaitTimeExponential (attempt = 0, base = 100, exponent = 2) {
|
|
96
96
|
if (attempt === 0) {
|
|
97
97
|
return 0
|
|
98
98
|
}
|
|
99
|
-
return (
|
|
99
|
+
return (exponent ** attempt) * base
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/**
|
|
@@ -171,6 +171,11 @@ export default class HttpRequest {
|
|
|
171
171
|
*/
|
|
172
172
|
exponentailBackoffBase = 100
|
|
173
173
|
|
|
174
|
+
/**
|
|
175
|
+
* The exponent to increase backoff each try
|
|
176
|
+
*/
|
|
177
|
+
exponentailBackoffExponent = 1.1
|
|
178
|
+
|
|
174
179
|
/**
|
|
175
180
|
* Authentication Map
|
|
176
181
|
* @type {Map}
|
|
@@ -199,6 +204,7 @@ export default class HttpRequest {
|
|
|
199
204
|
* @param {Set|String[]} [options.retryableHttpMethods] The list of retryable http methods
|
|
200
205
|
* @param {Number} [options.exponentailBackoffBase] The value for exponentail backoff base
|
|
201
206
|
* for retry exponential backoff
|
|
207
|
+
* @param {Number} [options.exponentailBackoffExponent] Exponent to increase backoff each try
|
|
202
208
|
*/
|
|
203
209
|
constructor (hosts, options = {}) {
|
|
204
210
|
this.setHosts(hosts)
|
|
@@ -212,6 +218,7 @@ export default class HttpRequest {
|
|
|
212
218
|
retryableErrorCodes,
|
|
213
219
|
retryableStatusCodes,
|
|
214
220
|
retryableHttpMethods,
|
|
221
|
+
exponentailBackoffExponent,
|
|
215
222
|
exponentailBackoffBase,
|
|
216
223
|
authentication,
|
|
217
224
|
} = options
|
|
@@ -251,6 +258,9 @@ export default class HttpRequest {
|
|
|
251
258
|
if (Number.isFinite(exponentailBackoffBase)) {
|
|
252
259
|
this.setExponentailBackoffBase(exponentailBackoffBase)
|
|
253
260
|
}
|
|
261
|
+
if (Number.isFinite(exponentailBackoffExponent)) {
|
|
262
|
+
this.setExponentailBackoffExponent(exponentailBackoffExponent)
|
|
263
|
+
}
|
|
254
264
|
}
|
|
255
265
|
|
|
256
266
|
/**
|
|
@@ -285,6 +295,22 @@ export default class HttpRequest {
|
|
|
285
295
|
return this.exponentailBackoffBase
|
|
286
296
|
}
|
|
287
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Set the exponentail backoff exponent
|
|
300
|
+
* @param {Number} exponentailBackoffExponent
|
|
301
|
+
*/
|
|
302
|
+
setExponentailBackoffExponent (exponentailBackoffExponent) {
|
|
303
|
+
this.exponentailBackoffExponent = exponentailBackoffExponent
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Get the exponentail backoff exponent
|
|
308
|
+
* @return {Number} The exponentail backoff exponent
|
|
309
|
+
*/
|
|
310
|
+
getExponentailBackoffExponent () {
|
|
311
|
+
return this.exponentailBackoffExponent
|
|
312
|
+
}
|
|
313
|
+
|
|
288
314
|
/**
|
|
289
315
|
* Set the retryable error codes
|
|
290
316
|
* @param {Set} retryableErrorCodes
|
|
@@ -591,6 +617,7 @@ export default class HttpRequest {
|
|
|
591
617
|
retryAttempt = 0,
|
|
592
618
|
redirectAttempt = 0,
|
|
593
619
|
attemptHostIndex,
|
|
620
|
+
exponentailBackoffExponent = this.getExponentailBackoffExponent(),
|
|
594
621
|
exponentailBackoffBase = this.getExponentailBackoffBase(),
|
|
595
622
|
httpAgent = this.getHttpAgent(),
|
|
596
623
|
httpsAgent = this.getHttpsAgent(),
|
|
@@ -675,11 +702,16 @@ export default class HttpRequest {
|
|
|
675
702
|
})
|
|
676
703
|
}
|
|
677
704
|
if (retryable && retryAttempt < retries) {
|
|
678
|
-
const waitTime = getWaitTimeExponential(
|
|
679
|
-
|
|
680
|
-
|
|
705
|
+
const waitTime = getWaitTimeExponential(
|
|
706
|
+
retryAttempt,
|
|
707
|
+
exponentailBackoffBase,
|
|
708
|
+
exponentailBackoffExponent,
|
|
709
|
+
)
|
|
710
|
+
await new Promise((resolve) => {
|
|
711
|
+
setTimeout(() => {
|
|
712
|
+
resolve(undefined)
|
|
713
|
+
}, waitTime)
|
|
681
714
|
})
|
|
682
|
-
await delayPromise
|
|
683
715
|
return this.fetch({
|
|
684
716
|
...options,
|
|
685
717
|
attempt: attempt + 1,
|
package/es6/index.js
CHANGED
|
@@ -6,6 +6,12 @@ import DataApiClient from './api/data'
|
|
|
6
6
|
import BackupApiClient from './api/backup'
|
|
7
7
|
import StatusApiClient from './api/status'
|
|
8
8
|
|
|
9
|
+
export {
|
|
10
|
+
DataApiClient,
|
|
11
|
+
BackupApiClient,
|
|
12
|
+
StatusApiClient,
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
export default {
|
|
10
16
|
DataApiClient,
|
|
11
17
|
BackupApiClient,
|
package/jsconfig.json
CHANGED
package/lib/api/backup/index.js
CHANGED
|
@@ -8,26 +8,26 @@ var _contentTypes = require("../../http-request/content-types"); /**
|
|
|
8
8
|
* @module api/backup
|
|
9
9
|
*/ /**
|
|
10
10
|
* The RQLite load api path
|
|
11
|
-
*/const PATH_LOAD = '/db/load';
|
|
11
|
+
*/const PATH_LOAD = exports.PATH_LOAD = '/db/load';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The RQLite backup api path
|
|
15
|
-
*/
|
|
16
|
-
const PATH_BACKUP = '/db/backup';
|
|
15
|
+
*/
|
|
16
|
+
const PATH_BACKUP = exports.PATH_BACKUP = '/db/backup';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Use plain SQL dump as the back up format
|
|
20
|
-
*/
|
|
21
|
-
const BACKUP_DATA_FORMAT_SQL = 'sql';
|
|
20
|
+
*/
|
|
21
|
+
const BACKUP_DATA_FORMAT_SQL = exports.BACKUP_DATA_FORMAT_SQL = 'sql';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Use sqlite3 dump as the back up format
|
|
25
|
-
*/
|
|
26
|
-
const BACKUP_DATA_FORMAT_DUMP = 'dump';
|
|
25
|
+
*/
|
|
26
|
+
const BACKUP_DATA_FORMAT_DUMP = exports.BACKUP_DATA_FORMAT_DUMP = 'dump';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Backup api client to perform RQLite back up and load operations
|
|
30
|
-
*/
|
|
30
|
+
*/
|
|
31
31
|
class BackupApiClient extends _httpRequest.default {
|
|
32
32
|
/**
|
|
33
33
|
* Perform a SQL dump backup from the RQLite server
|
|
@@ -38,14 +38,14 @@ class BackupApiClient extends _httpRequest.default {
|
|
|
38
38
|
const stream = _superprop_getGet().call(_this, {
|
|
39
39
|
headers: {
|
|
40
40
|
// Always sends application/octet-stream from the server in RQLite v4.x
|
|
41
|
-
Accept: _contentTypes.CONTENT_TYPE_APPLICATION_OCTET_STREAM
|
|
42
|
-
|
|
41
|
+
Accept: _contentTypes.CONTENT_TYPE_APPLICATION_OCTET_STREAM
|
|
42
|
+
},
|
|
43
43
|
query: { fmt: format === BACKUP_DATA_FORMAT_SQL ? format : undefined },
|
|
44
44
|
json: false,
|
|
45
45
|
stream: true,
|
|
46
46
|
uri: PATH_BACKUP,
|
|
47
|
-
useLeader: true
|
|
48
|
-
|
|
47
|
+
useLeader: true
|
|
48
|
+
});
|
|
49
49
|
return stream;})();
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -60,12 +60,13 @@ class BackupApiClient extends _httpRequest.default {
|
|
|
60
60
|
body: data,
|
|
61
61
|
headers: {
|
|
62
62
|
// eslint-disable-next-line max-len
|
|
63
|
-
'Content-Type': format === BACKUP_DATA_FORMAT_SQL ? _contentTypes.CONTENT_TYPE_TEXT_PLAIN : _contentTypes.CONTENT_TYPE_APPLICATION_OCTET_STREAM
|
|
64
|
-
|
|
63
|
+
'Content-Type': format === BACKUP_DATA_FORMAT_SQL ? _contentTypes.CONTENT_TYPE_TEXT_PLAIN : _contentTypes.CONTENT_TYPE_APPLICATION_OCTET_STREAM
|
|
64
|
+
},
|
|
65
65
|
json: false,
|
|
66
66
|
stream: true,
|
|
67
67
|
uri: PATH_LOAD,
|
|
68
|
-
useLeader: true
|
|
69
|
-
|
|
70
|
-
}
|
|
68
|
+
useLeader: true
|
|
69
|
+
});})();
|
|
70
|
+
}
|
|
71
|
+
}exports.default = BackupApiClient;
|
|
71
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PATH_LOAD","PATH_BACKUP","BACKUP_DATA_FORMAT_SQL","BACKUP_DATA_FORMAT_DUMP","BackupApiClient","HttpRequest","backup","format","stream","headers","Accept","CONTENT_TYPE_APPLICATION_OCTET_STREAM","query","fmt","undefined","json","uri","useLeader","load","data","body","CONTENT_TYPE_TEXT_PLAIN"],"sources":["../../../es6/api/backup/index.js"],"sourcesContent":["/**\n * Backup api client to perform RQLite back and load operations\n * @module api/backup\n */\nimport HttpRequest from '../../http-request'\nimport { CONTENT_TYPE_APPLICATION_OCTET_STREAM, CONTENT_TYPE_TEXT_PLAIN } from '../../http-request/content-types'\n\n/**\n * The RQLite load api path\n */\nexport const PATH_LOAD = '/db/load'\n\n/**\n * The RQLite backup api path\n */\nexport const PATH_BACKUP = '/db/backup'\n\n/**\n * Use plain SQL dump as the back up format\n */\nexport const BACKUP_DATA_FORMAT_SQL = 'sql'\n\n/**\n * Use sqlite3 dump as the back up format\n */\nexport const BACKUP_DATA_FORMAT_DUMP = 'dump'\n\n/**\n * Backup api client to perform RQLite back up and load operations\n */\nexport default class BackupApiClient extends HttpRequest {\n /**\n * Perform a SQL dump backup from the RQLite server\n * @param {String} [format=BACKUP_DATA_FORMAT_DUMP] The backup data format\n * @returns {Stream} The response stream\n */\n async backup (format = BACKUP_DATA_FORMAT_DUMP) {\n const stream = super.get({\n headers: {\n // Always sends application/octet-stream from the server in RQLite v4.x\n Accept: CONTENT_TYPE_APPLICATION_OCTET_STREAM,\n },\n query: { fmt: format === BACKUP_DATA_FORMAT_SQL ? format : undefined },\n json: false,\n stream: true,\n uri: PATH_BACKUP,\n useLeader: true,\n })\n return stream\n }\n\n /**\n * Perform a SQL restore by sending data the RQLite server\n * @param {Buffer|String} data The data to be loaded\n * @param {String} [format=BACKUP_DATA_FORMAT_SQL] The backup data format\n * @returns {Stream} The response stream\n */\n async load (data, format = BACKUP_DATA_FORMAT_SQL) {\n return super.post({\n body: data,\n headers: {\n // eslint-disable-next-line max-len\n 'Content-Type': format === BACKUP_DATA_FORMAT_SQL ? CONTENT_TYPE_TEXT_PLAIN : CONTENT_TYPE_APPLICATION_OCTET_STREAM,\n },\n json: false,\n stream: true,\n uri: PATH_LOAD,\n useLeader: true,\n })\n }\n}\n"],"mappings":";;;;AAIA;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_httpRequest","_interopRequireDefault","require","_contentTypes","PATH_LOAD","exports","PATH_BACKUP","BACKUP_DATA_FORMAT_SQL","BACKUP_DATA_FORMAT_DUMP","BackupApiClient","HttpRequest","backup","format","_superprop_getGet","get","_this","_asyncToGenerator2","default","stream","call","headers","Accept","CONTENT_TYPE_APPLICATION_OCTET_STREAM","query","fmt","undefined","json","uri","useLeader","load","data","_superprop_getPost","post","_this2","body","CONTENT_TYPE_TEXT_PLAIN"],"sources":["../../../es6/api/backup/index.js"],"sourcesContent":["/**\n * Backup api client to perform RQLite back and load operations\n * @module api/backup\n */\nimport HttpRequest from '../../http-request'\nimport { CONTENT_TYPE_APPLICATION_OCTET_STREAM, CONTENT_TYPE_TEXT_PLAIN } from '../../http-request/content-types'\n\n/**\n * The RQLite load api path\n */\nexport const PATH_LOAD = '/db/load'\n\n/**\n * The RQLite backup api path\n */\nexport const PATH_BACKUP = '/db/backup'\n\n/**\n * Use plain SQL dump as the back up format\n */\nexport const BACKUP_DATA_FORMAT_SQL = 'sql'\n\n/**\n * Use sqlite3 dump as the back up format\n */\nexport const BACKUP_DATA_FORMAT_DUMP = 'dump'\n\n/**\n * Backup api client to perform RQLite back up and load operations\n */\nexport default class BackupApiClient extends HttpRequest {\n /**\n * Perform a SQL dump backup from the RQLite server\n * @param {String} [format=BACKUP_DATA_FORMAT_DUMP] The backup data format\n * @returns {Stream} The response stream\n */\n async backup (format = BACKUP_DATA_FORMAT_DUMP) {\n const stream = super.get({\n headers: {\n // Always sends application/octet-stream from the server in RQLite v4.x\n Accept: CONTENT_TYPE_APPLICATION_OCTET_STREAM,\n },\n query: { fmt: format === BACKUP_DATA_FORMAT_SQL ? format : undefined },\n json: false,\n stream: true,\n uri: PATH_BACKUP,\n useLeader: true,\n })\n return stream\n }\n\n /**\n * Perform a SQL restore by sending data the RQLite server\n * @param {Buffer|String} data The data to be loaded\n * @param {String} [format=BACKUP_DATA_FORMAT_SQL] The backup data format\n * @returns {Stream} The response stream\n */\n async load (data, format = BACKUP_DATA_FORMAT_SQL) {\n return super.post({\n body: data,\n headers: {\n // eslint-disable-next-line max-len\n 'Content-Type': format === BACKUP_DATA_FORMAT_SQL ? CONTENT_TYPE_TEXT_PLAIN : CONTENT_TYPE_APPLICATION_OCTET_STREAM,\n },\n json: false,\n stream: true,\n uri: PATH_LOAD,\n useLeader: true,\n })\n }\n}\n"],"mappings":";;;;AAIA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA,qCAAiH,CALjH;AACA;AACA;AACA,GAHA,CAOA;AACA;AACA,GACO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,UAAU;;AAEnC;AACA;AACA;AACO,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAG,YAAY;;AAEvC;AACA;AACA;AACO,MAAMC,sBAAsB,GAAAF,OAAA,CAAAE,sBAAA,GAAG,KAAK;;AA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3
|
|
|
4
4
|
|
|
5
5
|
var _httpRequest = _interopRequireDefault(require("../../http-request"));
|
|
6
|
-
var _httpMethods = require("../../http-request/http-methods");function ownKeys(
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var _httpMethods = require("../../http-request/http-methods");function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {(0, _defineProperty2.default)(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;} /**
|
|
7
|
+
* Base API client for RQLite which abstracts the HTTP calls
|
|
8
|
+
* @module api/client
|
|
9
|
+
*/ /**
|
|
9
10
|
* @typedef HttpRequestOptions
|
|
10
11
|
* @type {import('../../http-request').HttpRequestOptions}
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
13
|
/**
|
|
14
14
|
* Create the base HTTP query options from RQLite API options
|
|
15
15
|
* @param {Object} [options={}] The RQLite API options
|
|
@@ -57,8 +57,8 @@ class ApiClient extends _httpRequest.default {
|
|
|
57
57
|
useLeader,
|
|
58
58
|
uri: path,
|
|
59
59
|
httpMethod: _httpMethods.HTTP_METHOD_GET,
|
|
60
|
-
query: _objectSpread(_objectSpread({}, createQuery(options)), {}, { q: sql })
|
|
61
|
-
|
|
60
|
+
query: _objectSpread(_objectSpread({}, createQuery(options)), {}, { q: sql })
|
|
61
|
+
});})();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -77,7 +77,8 @@ class ApiClient extends _httpRequest.default {
|
|
|
77
77
|
uri: path,
|
|
78
78
|
httpMethod: _httpMethods.HTTP_METHOD_POST,
|
|
79
79
|
query: createQuery(options),
|
|
80
|
-
body: Array.isArray(sql) ? sql : [sql]
|
|
81
|
-
|
|
82
|
-
}
|
|
80
|
+
body: Array.isArray(sql) ? sql : [sql]
|
|
81
|
+
});})();
|
|
82
|
+
}
|
|
83
|
+
}exports.default = ApiClient;
|
|
83
84
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["createQuery","options","level","pretty","timings","atomic","transaction","query","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_httpRequest","_interopRequireDefault","require","_httpMethods","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","createQuery","options","level","pretty","timings","atomic","transaction","query","entries","reduce","acc","entry","_entry","_slicedToArray2","key","val","ApiClient","HttpRequest","get","path","sql","_superprop_getGet","_this","_asyncToGenerator2","useLeader","Error","call","uri","httpMethod","HTTP_METHOD_GET","q","post","_superprop_getPost","_this2","HTTP_METHOD_POST","body","Array","isArray","exports"],"sources":["../../../es6/api/client/index.js"],"sourcesContent":["/**\n * Base API client for RQLite which abstracts the HTTP calls\n * @module api/client\n */\nimport HttpRequest from '../../http-request'\nimport { HTTP_METHOD_GET, HTTP_METHOD_POST } from '../../http-request/http-methods'\n\n/**\n * @typedef HttpRequestOptions\n * @type {import('../../http-request').HttpRequestOptions}\n */\n\n/**\n * Create the base HTTP query options from RQLite API options\n * @param {Object} [options={}] The RQLite API options\n * @param {String} [options.level] The consistency level\n * @param {String} [options.pretty] Pretty print the response body\n * @param {String} [options.timings] Provide query timings\n * @param {String} [options.atomic] Treat all commands in the request as a single transaction\n * for RQLite v5 and higher\n * @param {String} [options.transaction] Treat all commands in the request as a single transaction\n * for RQLite v4 and lower\n * @returns {Object} The HTTP query\n */\nexport function createQuery (options = {}) {\n const { level, pretty, timings, atomic, transaction } = options\n\n // Remove all undefined values\n const query = { level, pretty, timings, atomic, transaction }\n return Object.entries(query).reduce((acc, entry) => {\n const [key, val] = entry\n // Only take defined values\n if (typeof val !== 'undefined') {\n acc[key] = val\n }\n return acc\n }, {})\n}\n\n/**\n * Base API client for RQLite which abstracts the HTTP calls\n * from the user\n */\nexport default class ApiClient extends HttpRequest {\n /**\n * Perform a RQLite data API get request\n * @param {String} path The path for the request i.e. /db/query\n * @param {String} sql The SQL query\n * @param {HttpRequestOptions} [options={}] RQLite API options\n */\n async get (path, sql, options = {}) {\n const { useLeader } = options\n if (!path) {\n throw new Error('The path argument is required')\n }\n return super.get({\n useLeader,\n uri: path,\n httpMethod: HTTP_METHOD_GET,\n query: { ...createQuery(options), q: sql },\n })\n }\n\n /**\n * Perform a RQLite data API post request\n * @param {String} path The path for the request i.e. /db/query\n * @param {String} sql The SQL query\n * @param {HttpRequestOptions} [options={}] RQLite API options\n */\n async post (path, sql, options = {}) {\n const { useLeader } = options\n if (!path) {\n throw new Error('The path argument is required')\n }\n return super.post({\n useLeader,\n uri: path,\n httpMethod: HTTP_METHOD_POST,\n query: createQuery(options),\n body: Array.isArray(sql) ? sql : [sql],\n })\n }\n}\n"],"mappings":";;;;AAIA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA,oCAAmF,SAAAE,QAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,MAAAG,MAAA,CAAAE,qBAAA,OAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,EAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,UAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,MAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT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AAC;MAClD;MACA,OAAOO,kBAAA,GAAAN,IAAA,CAAAO,MAAA,EAAW;QAChBT,SAAS;QACTG,GAAG,EAAER,IAAI;QACTS,UAAU,EAAEM,6BAAgB;QAC5B3B,KAAK,EAAEP,WAAW,CAACC,OAAO,CAAC;QAC3BkC,IAAI,EAAEC,KAAK,CAACC,OAAO,CAACjB,GAAG,CAAC,GAAGA,GAAG,GAAG,CAACA,GAAG;MACvC,CAAC,CAAC;EACJ;AACF,CAACkB,OAAA,CAAA1C,OAAA,GAAAoB,SAAA","ignoreList":[]}
|
package/lib/api/data/index.js
CHANGED
|
@@ -1,38 +1,44 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.PATH_QUERY = exports.PATH_EXECUTE = exports.CONSISTENCY_LEVEL_WEAK = exports.CONSISTENCY_LEVEL_STRONG = exports.CONSISTENCY_LEVEL_NONE = void 0;var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
1
|
+
"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.PATH_QUERY = exports.PATH_EXECUTE = exports.CONSISTENCY_LEVEL_WEAK = exports.CONSISTENCY_LEVEL_STRONG = exports.CONSISTENCY_LEVEL_NONE = exports.CONSISTENCY_LEVEL_LINEARIZABLE = void 0;var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _client = _interopRequireDefault(require("../client"));
|
|
7
|
-
var _results = require("../results");function ownKeys(
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var _results = require("../results");function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {(0, _defineProperty2.default)(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;} /**
|
|
8
|
+
* Data api client to perform RQLite data operations such
|
|
9
|
+
* as query and execute
|
|
10
|
+
* @module api/data
|
|
11
|
+
*/ /**
|
|
10
12
|
* The RQLite query api path
|
|
11
|
-
*/
|
|
12
|
-
const PATH_QUERY = '/db/query';
|
|
13
|
-
|
|
13
|
+
*/const PATH_QUERY = exports.PATH_QUERY = '/db/query';
|
|
14
14
|
/**
|
|
15
15
|
* The RQLite execute api path
|
|
16
|
-
*/
|
|
17
|
-
const PATH_EXECUTE = '/db/execute';
|
|
16
|
+
*/
|
|
17
|
+
const PATH_EXECUTE = exports.PATH_EXECUTE = '/db/execute';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Read query consistency level none which means
|
|
21
21
|
* any node can respond
|
|
22
|
-
*/
|
|
23
|
-
const CONSISTENCY_LEVEL_NONE = 'none';
|
|
22
|
+
*/
|
|
23
|
+
const CONSISTENCY_LEVEL_NONE = exports.CONSISTENCY_LEVEL_NONE = 'none';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Read query consistency strong which must come from
|
|
27
27
|
* the master node
|
|
28
|
-
*/
|
|
29
|
-
const CONSISTENCY_LEVEL_STRONG = 'strong';
|
|
28
|
+
*/
|
|
29
|
+
const CONSISTENCY_LEVEL_STRONG = exports.CONSISTENCY_LEVEL_STRONG = 'strong';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Read query consistency linearizable which must come from
|
|
33
|
+
* the master node
|
|
34
|
+
*/
|
|
35
|
+
const CONSISTENCY_LEVEL_LINEARIZABLE = exports.CONSISTENCY_LEVEL_LINEARIZABLE = 'linearizable';
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
38
|
* Read query consistency weak which must come from
|
|
33
39
|
* the master node
|
|
34
|
-
*/
|
|
35
|
-
const CONSISTENCY_LEVEL_WEAK = 'weak';
|
|
40
|
+
*/
|
|
41
|
+
const CONSISTENCY_LEVEL_WEAK = exports.CONSISTENCY_LEVEL_WEAK = 'weak';
|
|
36
42
|
|
|
37
43
|
/**
|
|
38
44
|
* @typedef HttpRequestOptions
|
|
@@ -70,7 +76,7 @@ const CONSISTENCY_LEVEL_WEAK = 'weak';
|
|
|
70
76
|
* Send an RQLite query API request to the RQLite server
|
|
71
77
|
* @param {String} sql The SQL string to excute on the server
|
|
72
78
|
* @param {DataRequestBaseOptions} [options={}] RQLite api options
|
|
73
|
-
*/
|
|
79
|
+
*/
|
|
74
80
|
function handleResponse(response, options = {}) {
|
|
75
81
|
const raw = options.raw;
|
|
76
82
|
const body = response.body;
|
|
@@ -119,5 +125,6 @@ class DataApiClient extends _client.default {
|
|
|
119
125
|
execute(sql, options = {}) {var _superprop_getPost2 = () => super.post,_this2 = this;return (0, _asyncToGenerator2.default)(function* () {
|
|
120
126
|
const response = yield _superprop_getPost2().call(_this2, PATH_EXECUTE, sql, options);
|
|
121
127
|
return handleResponse(response, options);})();
|
|
122
|
-
}
|
|
128
|
+
}
|
|
129
|
+
}exports.default = DataApiClient;
|
|
123
130
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PATH_QUERY","PATH_EXECUTE","CONSISTENCY_LEVEL_NONE","CONSISTENCY_LEVEL_STRONG","CONSISTENCY_LEVEL_WEAK","handleResponse","response","options","raw","body","DataResults","DataApiClient","ApiClient","query","sql","level","useLeader","Array","isArray","setNextActiveHostIndex","execute"],"sources":["../../../es6/api/data/index.js"],"sourcesContent":["/**\n * Data api client to perform RQLite data operations such\n * as query and execute\n * @module api/data\n */\nimport ApiClient from '../client'\nimport { DataResults } from '../results'\n\n/**\n * The RQLite query api path\n */\nexport const PATH_QUERY = '/db/query'\n\n/**\n * The RQLite execute api path\n */\nexport const PATH_EXECUTE = '/db/execute'\n\n/**\n * Read query consistency level none which means\n * any node can respond\n */\nexport const CONSISTENCY_LEVEL_NONE = 'none'\n\n/**\n * Read query consistency strong which must come from\n * the master node\n */\nexport const CONSISTENCY_LEVEL_STRONG = 'strong'\n\n/**\n * Read query consistency weak which must come from\n * the master node\n */\nexport const CONSISTENCY_LEVEL_WEAK = 'weak'\n\n/**\n * @typedef HttpRequestOptions\n * @type {import('../../http-request').HttpRequestOptions}\n */\n\n/**\n * Data request base options\n * @typedef DataRequestBaseOptions\n * @type {Object}\n * @property {Boolean} [raw] If true return the raw http response from\n * RQLite response\n */\n\n/**\n * Data query request base options\n * @typedef QueryRequestBaseOptions\n * @type {Object}\n * @property {String} level The api consistency level\n */\n\n/**\n * Data query request options\n * @typedef QueryRequestOptions\n * @type {HttpRequestOptions & DataRequestBaseOptions & QueryRequestBaseOptions}\n */\n\n/**\n * Data execute request options\n * @typedef ExecuteRequestOptions\n * @type {HttpRequestOptions & DataRequestBaseOptions}\n */\n\n/**\n * Send an RQLite query API request to the RQLite server\n * @param {String} sql The SQL string to excute on the server\n * @param {DataRequestBaseOptions} [options={}] RQLite api options\n */\nfunction handleResponse (response, options = {}) {\n const { raw } = options\n const { body } = response\n if (raw) {\n return response\n }\n return new DataResults(body)\n}\n\n/**\n * Data api client to perform RQLite queries\n */\nexport default class DataApiClient extends ApiClient {\n /**\n * Send an RQLite query API request to the RQLite server\n * @param {String} sql The SQL string to excute on the server\n * @param {QueryRequestOptions} [options={}] RQLite api options\n */\n async query (sql, options = {}) {\n const { level } = options\n let { useLeader } = options\n // Weak and strong consistency will be redirect to the master anyway\n // so skip the redirect HTTP response and got right to the master\n if (level !== CONSISTENCY_LEVEL_NONE) {\n useLeader = true\n }\n let response\n if (Array.isArray(sql)) {\n response = await super.post(PATH_QUERY, sql, { ...options, useLeader })\n } else {\n response = await super.get(PATH_QUERY, sql, { ...options, useLeader })\n }\n // If round robin is true try and balance selects across hosts when\n // the master node is not queried directly\n if (!useLeader) {\n this.setNextActiveHostIndex()\n }\n return handleResponse(response, options)\n }\n\n /**\n * Send an RQLite execute API request to the RQLite server\n * @param {String} sql The SQL string to excute on the server\n * @param {ExecuteRequestOptions} [options={}] RQLite execute api options\n */\n async execute (sql, options = {}) {\n const response = await super.post(PATH_EXECUTE, sql, options)\n return handleResponse(response, options)\n }\n}\n"],"mappings":";;;;;AAKA;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_client","_interopRequireDefault","require","_results","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","PATH_QUERY","exports","PATH_EXECUTE","CONSISTENCY_LEVEL_NONE","CONSISTENCY_LEVEL_STRONG","CONSISTENCY_LEVEL_LINEARIZABLE","CONSISTENCY_LEVEL_WEAK","handleResponse","response","options","raw","body","DataResults","DataApiClient","ApiClient","query","sql","_superprop_getPost","post","_superprop_getGet","get","_this","_asyncToGenerator2","level","useLeader","Array","isArray","call","setNextActiveHostIndex","execute","_superprop_getPost2","_this2"],"sources":["../../../es6/api/data/index.js"],"sourcesContent":["/**\n * Data api client to perform RQLite data operations such\n * as query and execute\n * @module api/data\n */\nimport ApiClient from '../client'\nimport { DataResults } from '../results'\n\n/**\n * The RQLite query api path\n */\nexport const PATH_QUERY = '/db/query'\n\n/**\n * The RQLite execute api path\n */\nexport const PATH_EXECUTE = '/db/execute'\n\n/**\n * Read query consistency level none which means\n * any node can respond\n */\nexport const CONSISTENCY_LEVEL_NONE = 'none'\n\n/**\n * Read query consistency strong which must come from\n * the master node\n */\nexport const CONSISTENCY_LEVEL_STRONG = 'strong'\n\n/**\n * Read query consistency linearizable which must come from\n * the master node\n */\nexport const CONSISTENCY_LEVEL_LINEARIZABLE = 'linearizable'\n\n/**\n * Read query consistency weak which must come from\n * the master node\n */\nexport const CONSISTENCY_LEVEL_WEAK = 'weak'\n\n/**\n * @typedef HttpRequestOptions\n * @type {import('../../http-request').HttpRequestOptions}\n */\n\n/**\n * Data request base options\n * @typedef DataRequestBaseOptions\n * @type {Object}\n * @property {Boolean} [raw] If true return the raw http response from\n * RQLite response\n */\n\n/**\n * Data query request base options\n * @typedef QueryRequestBaseOptions\n * @type {Object}\n * @property {String} level The api consistency level\n */\n\n/**\n * Data query request options\n * @typedef QueryRequestOptions\n * @type {HttpRequestOptions & DataRequestBaseOptions & QueryRequestBaseOptions}\n */\n\n/**\n * Data execute request options\n * @typedef ExecuteRequestOptions\n * @type {HttpRequestOptions & DataRequestBaseOptions}\n */\n\n/**\n * Send an RQLite query API request to the RQLite server\n * @param {String} sql The SQL string to excute on the server\n * @param {DataRequestBaseOptions} [options={}] RQLite api options\n */\nfunction handleResponse (response, options = {}) {\n const { raw } = options\n const { body } = response\n if (raw) {\n return response\n }\n return new DataResults(body)\n}\n\n/**\n * Data api client to perform RQLite queries\n */\nexport default class DataApiClient extends ApiClient {\n /**\n * Send an RQLite query API request to the RQLite server\n * @param {String} sql The SQL string to excute on the server\n * @param {QueryRequestOptions} [options={}] RQLite api options\n */\n async query (sql, options = {}) {\n const { level } = options\n let { useLeader } = options\n // Weak and strong consistency will be redirect to the master anyway\n // so skip the redirect HTTP response and got right to the master\n if (level !== CONSISTENCY_LEVEL_NONE) {\n useLeader = true\n }\n let response\n if (Array.isArray(sql)) {\n response = await super.post(PATH_QUERY, sql, { ...options, useLeader })\n } else {\n response = await super.get(PATH_QUERY, sql, { ...options, useLeader })\n }\n // If round robin is true try and balance selects across hosts when\n // the master node is not queried directly\n if (!useLeader) {\n this.setNextActiveHostIndex()\n }\n return handleResponse(response, options)\n }\n\n /**\n * Send an RQLite execute API request to the RQLite server\n * @param {String} sql The SQL string to excute on the server\n * @param {ExecuteRequestOptions} [options={}] RQLite execute api options\n */\n async execute (sql, options = {}) {\n const response = await super.post(PATH_EXECUTE, sql, options)\n return handleResponse(response, options)\n }\n}\n"],"mappings":";;;;;AAKA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA,eAAwC,SAAAE,QAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,MAAAG,MAAA,CAAAE,qBAAA,OAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,EAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,UAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,MAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,UAAAJ,CAAA,WAAAU,cAAAZ,CAAA,YAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,SAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,OAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,OAAAe,gBAAA,CAAAC,OAAA,EAAAjB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,QAAAE,MAAA,CAAAe,yBAAA,GAAAf,MAAA,CAAAgB,gBAAA,CAAAnB,CAAA,EAAAG,MAAA,CAAAe,yBAAA,CAAAhB,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,GAAAE,MAA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6 @@ class DataResultError extends Error {
|
|
|
28
28
|
*/
|
|
29
29
|
toString() {
|
|
30
30
|
return JSON.stringify(this.toObject());
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
|
+
}exports.default = DataResultError;module.exports = exports.default;
|
|
32
33
|
//# sourceMappingURL=data-result-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-result-error.js","names":["DataResultError","Error","constructor","args","name","code","toObject","error","message","toString","JSON","stringify"],"sources":["../../../es6/api/results/data-result-error.js"],"sourcesContent":["/**\n * Class for handling RQLite data api result error\n * @module api/results/data-results\n */\n\n/**\n * A class that represents one data error result from an RQLite query or execute\n * API call\n */\nexport default class DataResultError extends Error {\n constructor (...args) {\n super(...args)\n this.name = this.constructor.name\n this.code = this.constructor.name\n }\n\n /**\n * Get the result data error as plain object\n * @returns {Object} The data as an object\n */\n toObject () {\n return { error: this.message }\n }\n\n /**\n * Convert the result data error to a JSON string\n * @returns {String} The JSON string for the data object\n */\n toString () {\n return JSON.stringify(this.toObject())\n }\n}\n"],"mappings":"qGAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACe,MAAMA,
|
|
1
|
+
{"version":3,"file":"data-result-error.js","names":["DataResultError","Error","constructor","args","name","code","toObject","error","message","toString","JSON","stringify","exports","default","module"],"sources":["../../../es6/api/results/data-result-error.js"],"sourcesContent":["/**\n * Class for handling RQLite data api result error\n * @module api/results/data-results\n */\n\n/**\n * A class that represents one data error result from an RQLite query or execute\n * API call\n */\nexport default class DataResultError extends Error {\n constructor (...args) {\n super(...args)\n this.name = this.constructor.name\n this.code = this.constructor.name\n }\n\n /**\n * Get the result data error as plain object\n * @returns {Object} The data as an object\n */\n toObject () {\n return { error: this.message }\n }\n\n /**\n * Convert the result data error to a JSON string\n * @returns {String} The JSON string for the data object\n */\n toString () {\n return JSON.stringify(this.toObject())\n }\n}\n"],"mappings":"qGAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACe,MAAMA,eAAe,SAASC,KAAK,CAAC;EACjDC,WAAWA,CAAE,GAAGC,IAAI,EAAE;IACpB,KAAK,CAAC,GAAGA,IAAI,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,IAAI,CAACF,WAAW,CAACE,IAAI;IACjC,IAAI,CAACC,IAAI,GAAG,IAAI,CAACH,WAAW,CAACE,IAAI;EACnC;;EAEA;AACF;AACA;AACA;EACEE,QAAQA,CAAA,EAAI;IACV,OAAO,EAAEC,KAAK,EAAE,IAAI,CAACC,OAAO,CAAC,CAAC;EAChC;;EAEA;AACF;AACA;AACA;EACEC,QAAQA,CAAA,EAAI;IACV,OAAOC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACL,QAAQ,CAAC,CAAC,CAAC;EACxC;AACF,CAACM,OAAA,CAAAC,OAAA,GAAAb,eAAA,CAAAc,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -8,34 +8,34 @@
|
|
|
8
8
|
* API call
|
|
9
9
|
*/
|
|
10
10
|
class DataResult {
|
|
11
|
-
/**
|
|
12
|
-
* The time the results query took to complete
|
|
13
|
-
* @type {Number}
|
|
14
|
-
*/
|
|
15
11
|
|
|
16
12
|
|
|
17
|
-
/**
|
|
18
|
-
* The last insert id
|
|
19
|
-
* @type {Number}
|
|
20
|
-
*/
|
|
21
13
|
|
|
22
14
|
|
|
23
|
-
/**
|
|
24
|
-
* The rows affected
|
|
25
|
-
* @type {Number}
|
|
26
|
-
*/
|
|
27
15
|
|
|
28
16
|
|
|
29
|
-
/**
|
|
30
|
-
* An array of DataResult and/or DataResultError instances
|
|
31
|
-
* @type {Array<DataResult|DataResultError>}
|
|
32
|
-
*/
|
|
33
17
|
|
|
34
18
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -43,26 +43,26 @@ class DataResult {
|
|
|
43
43
|
* @param {Array} result An API response individual result
|
|
44
44
|
* @param {Array} [valuesIndex] The index to get the values from the result
|
|
45
45
|
*/
|
|
46
|
-
constructor(result, valuesIndex) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
constructor(result, valuesIndex) {/**
|
|
47
|
+
* The time the results query took to complete
|
|
48
|
+
* @type {Number}
|
|
49
|
+
*/(0, _defineProperty2.default)(this, "time", 0.0); /**
|
|
50
|
+
* The last insert id
|
|
51
|
+
* @type {Number}
|
|
52
|
+
*/(0, _defineProperty2.default)(this, "lastInsertId", void 0); /**
|
|
53
|
+
* The rows affected
|
|
54
|
+
* @type {Number}
|
|
55
|
+
*/(0, _defineProperty2.default)(this, "rowsAffected", 0); /**
|
|
56
|
+
* An array of DataResult and/or DataResultError instances
|
|
57
|
+
* @type {Array<DataResult|DataResultError>}
|
|
58
|
+
*/(0, _defineProperty2.default)(this, "results", []); /**
|
|
59
|
+
* An object after the columns and values are mapped from
|
|
60
|
+
* an RQLite response
|
|
61
|
+
*/(0, _defineProperty2.default)(this, "data", {});if (typeof result !== 'object') {throw new Error('The result argument is required to be an object');}if (typeof valuesIndex !== 'undefined' && !Number.isFinite(valuesIndex)) {throw new Error('The valuesIndex argument is required to be a finite number when provided');}this.time = parseFloat(result.time || 0.0);this.rowsAffected = parseInt(result.rows_affected || 0, 10);this.lastInsertId = result.last_insert_id; // Map the values array to an object where columns are the properties
|
|
62
|
+
if (Number.isFinite(valuesIndex)) {const columns = result.columns;const resultValues = result.values[valuesIndex];if (resultValues) {this.data = resultValues.reduce((acc, val, i) => {const col = columns[i];
|
|
63
|
+
acc[col] = val;
|
|
64
|
+
return acc;
|
|
65
|
+
}, {});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -130,5 +130,6 @@ class DataResult {
|
|
|
130
130
|
*/
|
|
131
131
|
toString() {
|
|
132
132
|
return JSON.stringify(this.data);
|
|
133
|
-
}
|
|
133
|
+
}
|
|
134
|
+
}exports.default = DataResult;module.exports = exports.default;
|
|
134
135
|
//# sourceMappingURL=data-result.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-result.js","names":["DataResult","constructor","result","valuesIndex","Error","Number","isFinite","time","parseFloat","rowsAffected","parseInt","rows_affected","lastInsertId","last_insert_id","columns","resultValues","values","data","reduce","acc","val","i","col","get","property","getTime","getLastInsertId","getRowsAffected","toObject","JSON","parse","stringify","toArray","Object","toColumnsArray","keys","toString"],"sources":["../../../es6/api/results/data-result.js"],"sourcesContent":["/**\n * Class for handling single RQLite data api result\n * @module api/results/data-result\n */\n\n/**\n * A class that represents one data result from an RQLite query or execute\n * API call\n */\nexport default class DataResult {\n /**\n * The time the results query took to complete\n * @type {Number}\n */\n time = 0.0\n\n /**\n * The last insert id\n * @type {Number}\n */\n lastInsertId\n\n /**\n * The rows affected\n * @type {Number}\n */\n rowsAffected = 0\n\n /**\n * An array of DataResult and/or DataResultError instances\n * @type {Array<DataResult|DataResultError>}\n */\n results = []\n\n /**\n * An object after the columns and values are mapped from\n * an RQLite response\n */\n data = {}\n\n /**\n * The data result constructor\n * @param {Array} result An API response individual result\n * @param {Array} [valuesIndex] The index to get the values from the result\n */\n constructor (result, valuesIndex) {\n if (typeof result !== 'object') {\n throw new Error('The result argument is required to be an object')\n }\n if (typeof valuesIndex !== 'undefined' && !Number.isFinite(valuesIndex)) {\n throw new Error('The valuesIndex argument is required to be a finite number when provided')\n }\n this.time = parseFloat(result.time || 0.0)\n this.rowsAffected = parseInt(result.rows_affected || 0, 10)\n this.lastInsertId = result.last_insert_id\n // Map the values array to an object where columns are the properties\n if (Number.isFinite(valuesIndex)) {\n const { columns } = result\n const resultValues = result.values[valuesIndex]\n if (resultValues) {\n this.data = resultValues.reduce((acc, val, i) => {\n const col = columns[i]\n acc[col] = val\n return acc\n }, {})\n }\n }\n }\n\n /**\n * Return the value a property or undefined if it does not exist\n * @returns {*} The value of the property or undefined\n */\n get (property) {\n return this.data[property]\n }\n\n /**\n * Get the time the result took\n * @returns {Number} The time the query took\n */\n getTime () {\n return this.time\n }\n\n /**\n * Get the last insert id\n * @returns {Number|undefined}\n */\n getLastInsertId () {\n return this.lastInsertId\n }\n\n /**\n * Get the row affected\n * @returns {Number|undefined}\n */\n getRowsAffected () {\n return this.rowsAffected\n }\n\n /**\n * Get the result data as plain object\n * @returns {Object} The data as an object\n */\n toObject () {\n // Clone deep\n return JSON.parse(JSON.stringify(this.data))\n }\n\n /**\n * Map the data values to an array\n * @returns {Array}\n */\n toArray () {\n return Object.values(this.data)\n }\n\n /**\n * Map the data properites to an array\n * @returns {String[]}\n */\n toColumnsArray () {\n return Object.keys(this.data)\n }\n\n /**\n * Convert the result data to a JSON string\n * @returns {String} The JSON string for the data object\n */\n toString () {\n return JSON.stringify(this.data)\n }\n}\n"],"mappings":"0RAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACe,MAAMA,
|
|
1
|
+
{"version":3,"file":"data-result.js","names":["DataResult","constructor","result","valuesIndex","_defineProperty2","default","Error","Number","isFinite","time","parseFloat","rowsAffected","parseInt","rows_affected","lastInsertId","last_insert_id","columns","resultValues","values","data","reduce","acc","val","i","col","get","property","getTime","getLastInsertId","getRowsAffected","toObject","JSON","parse","stringify","toArray","Object","toColumnsArray","keys","toString","exports","module"],"sources":["../../../es6/api/results/data-result.js"],"sourcesContent":["/**\n * Class for handling single RQLite data api result\n * @module api/results/data-result\n */\n\n/**\n * A class that represents one data result from an RQLite query or execute\n * API call\n */\nexport default class DataResult {\n /**\n * The time the results query took to complete\n * @type {Number}\n */\n time = 0.0\n\n /**\n * The last insert id\n * @type {Number}\n */\n lastInsertId\n\n /**\n * The rows affected\n * @type {Number}\n */\n rowsAffected = 0\n\n /**\n * An array of DataResult and/or DataResultError instances\n * @type {Array<DataResult|DataResultError>}\n */\n results = []\n\n /**\n * An object after the columns and values are mapped from\n * an RQLite response\n */\n data = {}\n\n /**\n * The data result constructor\n * @param {Array} result An API response individual result\n * @param {Array} [valuesIndex] The index to get the values from the result\n */\n constructor (result, valuesIndex) {\n if (typeof result !== 'object') {\n throw new Error('The result argument is required to be an object')\n }\n if (typeof valuesIndex !== 'undefined' && !Number.isFinite(valuesIndex)) {\n throw new Error('The valuesIndex argument is required to be a finite number when provided')\n }\n this.time = parseFloat(result.time || 0.0)\n this.rowsAffected = parseInt(result.rows_affected || 0, 10)\n this.lastInsertId = result.last_insert_id\n // Map the values array to an object where columns are the properties\n if (Number.isFinite(valuesIndex)) {\n const { columns } = result\n const resultValues = result.values[valuesIndex]\n if (resultValues) {\n this.data = resultValues.reduce((acc, val, i) => {\n const col = columns[i]\n acc[col] = val\n return acc\n }, {})\n }\n }\n }\n\n /**\n * Return the value a property or undefined if it does not exist\n * @returns {*} The value of the property or undefined\n */\n get (property) {\n return this.data[property]\n }\n\n /**\n * Get the time the result took\n * @returns {Number} The time the query took\n */\n getTime () {\n return this.time\n }\n\n /**\n * Get the last insert id\n * @returns {Number|undefined}\n */\n getLastInsertId () {\n return this.lastInsertId\n }\n\n /**\n * Get the row affected\n * @returns {Number|undefined}\n */\n getRowsAffected () {\n return this.rowsAffected\n }\n\n /**\n * Get the result data as plain object\n * @returns {Object} The data as an object\n */\n toObject () {\n // Clone deep\n return JSON.parse(JSON.stringify(this.data))\n }\n\n /**\n * Map the data values to an array\n * @returns {Array}\n */\n toArray () {\n return Object.values(this.data)\n }\n\n /**\n * Map the data properites to an array\n * @returns {String[]}\n */\n toColumnsArray () {\n return Object.keys(this.data)\n }\n\n /**\n * Convert the result data to a JSON string\n * @returns {String} The JSON string for the data object\n */\n toString () {\n return JSON.stringify(this.data)\n }\n}\n"],"mappings":"0RAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACe,MAAMA,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B9B;AACF;AACA;AACA;AACA;EACEC,WAAWA,CAAEC,MAAM,EAAEC,WAAW,EAAE,CAnClC;AACF;AACA;AACA,OAHE,IAAAC,gBAAA,CAAAC,OAAA,gBAIO,GAAG,GAEV;AACF;AACA;AACA,OAHE,IAAAD,gBAAA,CAAAC,OAAA,iCAMA;AACF;AACA;AACA,OAHE,IAAAD,gBAAA,CAAAC,OAAA,wBAIe,CAAC,GAEhB;AACF;AACA;AACA,OAHE,IAAAD,gBAAA,CAAAC,OAAA,mBAIU,EAAE,GAEZ;AACF;AACA;AACA,OAHE,IAAAD,gBAAA,CAAAC,OAAA,gBAIO,CAAC,CAAC,EAQP,IAAI,OAAOH,MAAM,KAAK,QAAQ,EAAE,CAC9B,MAAM,IAAII,KAAK,CAAC,iDAAiD,CAAC,CACpE,CACA,IAAI,OAAOH,WAAW,KAAK,WAAW,IAAI,CAACI,MAAM,CAACC,QAAQ,CAACL,WAAW,CAAC,EAAE,CACvE,MAAM,IAAIG,KAAK,CAAC,0EAA0E,CAAC,CAC7F,CACA,IAAI,CAACG,IAAI,GAAGC,UAAU,CAACR,MAAM,CAACO,IAAI,IAAI,GAAG,CAAC,CAC1C,IAAI,CAACE,YAAY,GAAGC,QAAQ,CAACV,MAAM,CAACW,aAAa,IAAI,CAAC,EAAE,EAAE,CAAC,CAC3D,IAAI,CAACC,YAAY,GAAGZ,MAAM,CAACa,cAAc,EACzC;IACA,IAAIR,MAAM,CAACC,QAAQ,CAACL,WA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