@malloydata/malloy 0.0.123-dev240205203117 → 0.0.123-dev240207162055

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.
@@ -76,7 +76,7 @@ class DuckDBDialect extends dialect_1.Dialect {
76
76
  return `__udf${Math.floor(Math.random() * 100000)}`;
77
77
  }
78
78
  quoteTablePath(tableName) {
79
- return tableName.match(/\//) ? `'${tableName}'` : tableName;
79
+ return tableName.match(/[/*:]/) ? `'${tableName}'` : tableName;
80
80
  }
81
81
  sqlGroupSetTable(groupSetCount) {
82
82
  return `CROSS JOIN (SELECT UNNEST(GENERATE_SERIES(0,${groupSetCount},1)) as group_set ) as group_set`;
@@ -35,7 +35,7 @@ class ExprMinus extends expression_def_1.ExpressionDef {
35
35
  }
36
36
  getExpression(fs) {
37
37
  const expr = this.expr.getExpression(fs);
38
- if (this.typeCheck(this.expr, expr)) {
38
+ if (fragtype_utils_1.FT.typeIn(expr, this.legalChildTypes)) {
39
39
  if (expr.value.length > 1) {
40
40
  return { ...expr, dataType: 'number', value: ['-(', ...expr.value, ')'] };
41
41
  }
@@ -15,6 +15,12 @@ export declare class FT {
15
15
  * @param checkThis The possibly undefined candidate
16
16
  */
17
17
  static eq(good: TypeDesc, checkThis: TypeDesc | undefined): boolean;
18
+ /**
19
+ * Checks if a given type is in a list, ignoring aggregate
20
+ * @param check The type to check (can be undefined)
21
+ * @param from List of types which are OK
22
+ */
23
+ static typeIn(check: TypeDesc | undefined, from: TypeDesc[]): boolean;
18
24
  /**
19
25
  * Checks if the base types, ignoring aggregate, are equal
20
26
  * @param left Left type
@@ -53,6 +53,18 @@ class FT {
53
53
  good.dataType === checkThis.dataType &&
54
54
  good.expressionType === checkThis.expressionType);
55
55
  }
56
+ /**
57
+ * Checks if a given type is in a list, ignoring aggregate
58
+ * @param check The type to check (can be undefined)
59
+ * @param from List of types which are OK
60
+ */
61
+ static typeIn(check, from) {
62
+ if (check) {
63
+ const found = from.find(okType => FT.typeEq(okType, check));
64
+ return found !== undefined;
65
+ }
66
+ return false;
67
+ }
56
68
  /**
57
69
  * Checks if the base types, ignoring aggregate, are equal
58
70
  * @param left Left type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.123-dev240205203117",
3
+ "version": "0.0.123-dev240207162055",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",