@malloydata/malloy 0.0.301 → 0.0.303

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.
@@ -111,7 +111,7 @@ class ExprFunc extends expression_def_1.ExpressionDef {
111
111
  return { found: func, error: undefined };
112
112
  }
113
113
  getPropsExpression(fs, props) {
114
- var _a, _b, _c, _d;
114
+ var _a, _b, _c, _d, _e;
115
115
  const argExprsWithoutImplicit = this.args.map(arg => arg.getExpression(fs));
116
116
  if (this.isRaw) {
117
117
  const funcCall = [`${this.name}(`];
@@ -280,6 +280,7 @@ class ExprFunc extends expression_def_1.ExpressionDef {
280
280
  }
281
281
  frag.partitionBy = partitionByFields;
282
282
  }
283
+ const sqlFunctionFieldUsage = [];
283
284
  if ([
284
285
  'sql_number',
285
286
  'sql_string',
@@ -312,9 +313,11 @@ class ExprFunc extends expression_def_1.ExpressionDef {
312
313
  if (result.found === undefined) {
313
314
  return this.loggedErrorExpr('sql-function-interpolation-not-found', `Invalid interpolation: ${result.error.message}`);
314
315
  }
315
- if (result.found.typeDesc().type === 'filter expression') {
316
+ const typeDesc = result.found.typeDesc();
317
+ if (typeDesc.type === 'filter expression') {
316
318
  return this.loggedErrorExpr('filter-expression-error', 'Filter expressions cannot be used in sql_ functions');
317
319
  }
320
+ sqlFunctionFieldUsage.push(...((_e = typeDesc.fieldUsage) !== null && _e !== void 0 ? _e : []));
318
321
  if (result.found.refType === 'parameter') {
319
322
  expr.push({ node: 'parameter', path: part.path });
320
323
  }
@@ -350,7 +353,7 @@ class ExprFunc extends expression_def_1.ExpressionDef {
350
353
  expressionType,
351
354
  value: funcCall,
352
355
  evalSpace,
353
- fieldUsage: (0, composite_source_utils_1.mergeFieldUsage)(...argExprs.map(e => e.fieldUsage)),
356
+ fieldUsage: (0, composite_source_utils_1.mergeFieldUsage)(...argExprs.map(e => e.fieldUsage), sqlFunctionFieldUsage),
354
357
  };
355
358
  }
356
359
  }
@@ -356,7 +356,7 @@ function getPartitionCompositeDesc(annotation, structDef, logTo) {
356
356
  logTo.logError('invalid-partition-composite', `Invalid partition specification for \`${id}\`; must be a tag with property \\fields\``);
357
357
  return undefined;
358
358
  }
359
- const fields = Object.keys(partitionsTag.getProperties());
359
+ const fields = Object.keys(partitionTag.getProperties());
360
360
  allFields.forEach(f => allFields.add(f));
361
361
  partitions.push({ id, fields });
362
362
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.301";
1
+ export declare const MALLOY_VERSION = "0.0.303";
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.301';
5
+ exports.MALLOY_VERSION = '0.0.303';
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.301",
3
+ "version": "0.0.303",
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.301",
45
- "@malloydata/malloy-interfaces": "0.0.301",
46
- "@malloydata/malloy-tag": "0.0.301",
44
+ "@malloydata/malloy-filter": "0.0.303",
45
+ "@malloydata/malloy-interfaces": "0.0.303",
46
+ "@malloydata/malloy-tag": "0.0.303",
47
47
  "antlr4ts": "^0.5.0-alpha.4",
48
48
  "assert": "^2.0.0",
49
49
  "jaro-winkler": "^0.2.8",