@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/query-builder.js +9 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/pged",
3
- "version": "5.0.15",
3
+ "version": "5.0.17",
4
4
  "description": "Just a silly little db management and query builder for PostgreSQL.",
5
5
  "main": "index.js",
6
6
  "type": "module",
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 (!Array.isArray(keys)) {
71
- keys = [].concat(...keys.split('"').map((key, idx) => {
72
- if (idx % 2 == 0) return key.split(/, ?/);
73
- return [key];
74
- })).filter((key) => key);
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: