@malloydata/malloy 0.0.317 → 0.0.319

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.
@@ -23,11 +23,8 @@ function invertCompare(no) {
23
23
  return '>';
24
24
  }
25
25
  function unlike(disLiked, x) {
26
- const orNull = ` OR ${x} IS NULL`;
27
- if (disLiked.length === 1) {
28
- return `${disLiked[0]}${orNull}`;
29
- }
30
- return `(${disLiked.join(' AND ')})${orNull}`;
26
+ const unlikeSQL = disLiked.length === 1 ? disLiked[0] : `(${disLiked.join(' AND ')})`;
27
+ return `(${unlikeSQL} OR ${x} IS NULL)`;
31
28
  }
32
29
  /*
33
30
  * These compilers from filter expression to SQL actually belong in malloy-filters but
@@ -63,11 +60,11 @@ exports.FilterCompilers = {
63
60
  const optList = nc.values.join(', ');
64
61
  if (nc.values.length === 1) {
65
62
  if (notEqual)
66
- return `${x} != ${optList} OR ${x} IS NULL`;
63
+ return `(${x} != ${optList} OR ${x} IS NULL)`;
67
64
  return `${x} = ${optList}`;
68
65
  }
69
66
  if (notEqual)
70
- return `${x} NOT IN (${optList}) OR ${x} IS NULL`;
67
+ return `(${x} NOT IN (${optList}) OR ${x} IS NULL)`;
71
68
  return `${x} IN (${optList})`;
72
69
  }
73
70
  case '>':
@@ -303,7 +300,7 @@ class TemporalFilterCompiler {
303
300
  const m = this.moment(tc.in);
304
301
  if (m.begin.sql === m.end) {
305
302
  return tc.not
306
- ? `${x} != ${this.time(m.end)} OR ${x} IS NULL`
303
+ ? `(${x} != ${this.time(m.end)} OR ${x} IS NULL)`
307
304
  : `${x} = ${this.time(m.end)}`;
308
305
  }
309
306
  return this.isIn(tc.not, m.begin.sql, m.end);
@@ -1044,7 +1044,8 @@ class QueryQuery extends query_node_1.QueryField {
1044
1044
  }
1045
1045
  else {
1046
1046
  // its a complex
1047
- limitComplexClauses[result.groupSet] = `CASE WHEN ${filterClause} THEN 1 ELSE 0 END`;
1047
+ limitComplexClauses[result.groupSet] =
1048
+ `CASE WHEN ${filterClause} THEN 1 ELSE 0 END`;
1048
1049
  }
1049
1050
  }
1050
1051
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.317";
1
+ export declare const MALLOY_VERSION = "0.0.319";
package/dist/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MALLOY_VERSION = void 0;
4
4
  // generated with 'generate-version-file' script; do not edit manually
5
- exports.MALLOY_VERSION = '0.0.317';
5
+ exports.MALLOY_VERSION = '0.0.319';
6
6
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.317",
3
+ "version": "0.0.319",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -41,9 +41,9 @@
41
41
  "generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@malloydata/malloy-filter": "0.0.317",
45
- "@malloydata/malloy-interfaces": "0.0.317",
46
- "@malloydata/malloy-tag": "0.0.317",
44
+ "@malloydata/malloy-filter": "0.0.319",
45
+ "@malloydata/malloy-interfaces": "0.0.319",
46
+ "@malloydata/malloy-tag": "0.0.319",
47
47
  "antlr4ts": "^0.5.0-alpha.4",
48
48
  "assert": "^2.0.0",
49
49
  "jaro-winkler": "^0.2.8",