@trenskow/pged 5.0.15 → 5.0.17
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/package.json +1 -1
- package/query-builder.js +9 -5
package/package.json
CHANGED
package/query-builder.js
CHANGED
|
@@ -67,11 +67,13 @@ export default class QueryBuilder extends CustomPromise {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
select(keys = ['*']) {
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
if (typeof keys !== 'string' || keys[0] !== ':') {
|
|
71
|
+
if (!Array.isArray(keys)) {
|
|
72
|
+
keys = [].concat(...keys.split('"').map((key, idx) => {
|
|
73
|
+
if (idx % 2 == 0) return key.split(/, ?/);
|
|
74
|
+
return [key];
|
|
75
|
+
})).filter((key) => key);
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
this._selectKeys = (this._selectKeys || []).concat(keys);
|
|
77
79
|
return this;
|
|
@@ -385,6 +387,8 @@ export default class QueryBuilder extends CustomPromise {
|
|
|
385
387
|
switch (comparer) {
|
|
386
388
|
case '$eq':
|
|
387
389
|
return `${dbKey} is null`;
|
|
390
|
+
case '$neq':
|
|
391
|
+
// fallthrough
|
|
388
392
|
case '$ne':
|
|
389
393
|
return `${dbKey} is not null`;
|
|
390
394
|
default:
|