@pi-r/redis 0.12.3 → 0.12.5
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/client/index.js +5 -7
- package/package.json +3 -3
package/client/index.js
CHANGED
|
@@ -118,9 +118,9 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
118
118
|
if (length === 0) {
|
|
119
119
|
return [];
|
|
120
120
|
}
|
|
121
|
-
let parallel, checkObject, connectOnce, errorQuery, sessionKey, outCacheMiss;
|
|
121
|
+
let parallel, checkObject, connectOnce, errorQuery, errorAsEmpty, sessionKey, outCacheMiss;
|
|
122
122
|
if (isPlainObject(options)) {
|
|
123
|
-
({ parallel, checkObject, connectOnce, errorQuery, sessionKey, outCacheMiss } = options);
|
|
123
|
+
({ parallel, checkObject, connectOnce, errorQuery, errorAsEmpty, sessionKey, outCacheMiss } = options);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
126
|
if (typeof options === 'string') {
|
|
@@ -179,7 +179,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
179
179
|
const item = batch[i];
|
|
180
180
|
const { source, key, search, aggregate, streams, options: clientOptions = {}, ignoreCache } = item;
|
|
181
181
|
let credential = redisCredential || onceCredential, error;
|
|
182
|
-
if (!credential && !isPlainObject(credential = clientOptions.client) && (error = errorMessage(source, "Invalid credentials")) || !(isString(key) || isArray(key) || isPlainObject(search) && (isPlainObject(search.schema) || isString(search.query)) || isPlainObject(aggregate) && (isPlainObject(aggregate.schema) || isString(aggregate.query))) && (error = errorMessage(source, "Missing database query", item.uri))) {
|
|
182
|
+
if (!credential && !isPlainObject(credential = clientOptions.client) && (error = errorMessage(source, "Invalid credentials")) || !(isString(key) || isArray(key) || streams || isPlainObject(search) && (isPlainObject(search.schema) || isString(search.query) || clientOptions.hybrid) || isPlainObject(aggregate) && (isPlainObject(aggregate.schema) || isString(aggregate.query))) && (error = errorMessage(source, "Missing database query", item.uri))) {
|
|
183
183
|
if (this.handleFail(error, item, { errorQuery })) {
|
|
184
184
|
if (!parallel) {
|
|
185
185
|
tasks.length = 0;
|
|
@@ -557,10 +557,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
else if (streams) {
|
|
560
|
-
|
|
561
|
-
if (data) {
|
|
562
|
-
rows = data;
|
|
563
|
-
}
|
|
560
|
+
rows = await client.xRead(streams, clientOptions.xread);
|
|
564
561
|
}
|
|
565
562
|
else if (key) {
|
|
566
563
|
let data;
|
|
@@ -655,6 +652,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
655
652
|
}
|
|
656
653
|
return this.processRows(batch, tasks, {
|
|
657
654
|
parallel,
|
|
655
|
+
errorAsEmpty,
|
|
658
656
|
disconnect() {
|
|
659
657
|
for (const item of clients) {
|
|
660
658
|
item.destroy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/redis",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"description": "Redis client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@e-mc/db": "^0.14.
|
|
21
|
-
"@e-mc/types": "^0.14.
|
|
20
|
+
"@e-mc/db": "^0.14.6",
|
|
21
|
+
"@e-mc/types": "^0.14.6",
|
|
22
22
|
"redis": "^5.12.1"
|
|
23
23
|
}
|
|
24
24
|
}
|