@malloydata/malloy 0.0.22-dev230207182613 → 0.0.22-dev230207183024

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 (155) hide show
  1. package/dist/connection_utils.js +7 -7
  2. package/dist/dialect/dialect.d.ts +1 -1
  3. package/dist/dialect/duckdb.d.ts +1 -1
  4. package/dist/dialect/duckdb.js +9 -9
  5. package/dist/dialect/postgres.d.ts +1 -1
  6. package/dist/dialect/postgres.js +16 -16
  7. package/dist/dialect/standardsql.d.ts +1 -1
  8. package/dist/dialect/standardsql.js +8 -8
  9. package/dist/index.d.ts +6 -6
  10. package/dist/lang/ast/ast-utils.js +3 -3
  11. package/dist/lang/ast/elements/define-query.js +4 -4
  12. package/dist/lang/ast/elements/define-source.d.ts +1 -1
  13. package/dist/lang/ast/elements/define-source.js +8 -8
  14. package/dist/lang/ast/elements/import-statement.js +2 -2
  15. package/dist/lang/ast/elements/pipeline-desc.d.ts +1 -1
  16. package/dist/lang/ast/elements/pipeline-desc.js +7 -7
  17. package/dist/lang/ast/elements/refined-source.d.ts +1 -1
  18. package/dist/lang/ast/elements/refined-source.js +5 -5
  19. package/dist/lang/ast/elements/source.js +1 -1
  20. package/dist/lang/ast/error-factory.js +16 -13
  21. package/dist/lang/ast/expressions/binary-boolean.d.ts +1 -1
  22. package/dist/lang/ast/expressions/binary-boolean.js +4 -4
  23. package/dist/lang/ast/expressions/binary-numeric.d.ts +1 -1
  24. package/dist/lang/ast/expressions/binary-numeric.js +1 -1
  25. package/dist/lang/ast/expressions/boolean.js +1 -1
  26. package/dist/lang/ast/expressions/constant-sub-expression.js +7 -7
  27. package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +3 -3
  28. package/dist/lang/ast/expressions/expr-aggregate-function.js +12 -12
  29. package/dist/lang/ast/expressions/expr-alternation-tree.js +3 -3
  30. package/dist/lang/ast/expressions/expr-asymmetric.d.ts +1 -1
  31. package/dist/lang/ast/expressions/expr-asymmetric.js +1 -1
  32. package/dist/lang/ast/expressions/expr-avg.d.ts +1 -1
  33. package/dist/lang/ast/expressions/expr-avg.js +1 -1
  34. package/dist/lang/ast/expressions/expr-cast.d.ts +1 -1
  35. package/dist/lang/ast/expressions/expr-cast.js +26 -4
  36. package/dist/lang/ast/expressions/expr-compare.d.ts +1 -1
  37. package/dist/lang/ast/expressions/expr-compare.js +3 -3
  38. package/dist/lang/ast/expressions/expr-count.js +6 -6
  39. package/dist/lang/ast/expressions/expr-filter.d.ts +2 -2
  40. package/dist/lang/ast/expressions/expr-filter.js +8 -8
  41. package/dist/lang/ast/expressions/expr-func.d.ts +1 -1
  42. package/dist/lang/ast/expressions/expr-func.js +3 -3
  43. package/dist/lang/ast/expressions/expr-granular-time.js +7 -7
  44. package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
  45. package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
  46. package/dist/lang/ast/expressions/expr-minus.d.ts +1 -1
  47. package/dist/lang/ast/expressions/expr-minus.js +3 -3
  48. package/dist/lang/ast/expressions/expr-not.js +2 -2
  49. package/dist/lang/ast/expressions/expr-now.js +7 -7
  50. package/dist/lang/ast/expressions/expr-null.js +3 -3
  51. package/dist/lang/ast/expressions/expr-number.js +1 -1
  52. package/dist/lang/ast/expressions/expr-parens.js +2 -2
  53. package/dist/lang/ast/expressions/expr-regex.js +3 -3
  54. package/dist/lang/ast/expressions/expr-string.js +6 -6
  55. package/dist/lang/ast/expressions/expr-sum.d.ts +1 -1
  56. package/dist/lang/ast/expressions/expr-sum.js +1 -1
  57. package/dist/lang/ast/expressions/expr-time-extract.d.ts +1 -1
  58. package/dist/lang/ast/expressions/expr-time-extract.js +29 -29
  59. package/dist/lang/ast/expressions/expr-time.js +7 -7
  60. package/dist/lang/ast/expressions/expr-ungroup.d.ts +2 -2
  61. package/dist/lang/ast/expressions/expr-ungroup.js +11 -8
  62. package/dist/lang/ast/expressions/for-range.d.ts +1 -1
  63. package/dist/lang/ast/expressions/for-range.js +1 -1
  64. package/dist/lang/ast/expressions/granular-literal.js +12 -12
  65. package/dist/lang/ast/expressions/partial-compare.d.ts +1 -1
  66. package/dist/lang/ast/expressions/partial-compare.js +1 -1
  67. package/dist/lang/ast/expressions/pick-when.d.ts +1 -1
  68. package/dist/lang/ast/expressions/pick-when.js +11 -11
  69. package/dist/lang/ast/expressions/range.js +4 -4
  70. package/dist/lang/ast/expressions/top-by.d.ts +1 -1
  71. package/dist/lang/ast/expressions/top-by.js +4 -4
  72. package/dist/lang/ast/expressions/unary.js +1 -1
  73. package/dist/lang/ast/field-space/dynamic-space.d.ts +1 -1
  74. package/dist/lang/ast/field-space/dynamic-space.js +1 -1
  75. package/dist/lang/ast/field-space/index-field-space.js +2 -2
  76. package/dist/lang/ast/field-space/query-field-struct.js +1 -1
  77. package/dist/lang/ast/field-space/query-space-field.js +1 -1
  78. package/dist/lang/ast/field-space/query-spaces.js +2 -2
  79. package/dist/lang/ast/field-space/reference-field.js +1 -1
  80. package/dist/lang/ast/field-space/rename-space-field.js +2 -2
  81. package/dist/lang/ast/field-space/static-space.js +8 -8
  82. package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
  83. package/dist/lang/ast/fragtype-utils.js +2 -2
  84. package/dist/lang/ast/parameters/constant-parameter.js +9 -9
  85. package/dist/lang/ast/parameters/has-parameter.js +5 -5
  86. package/dist/lang/ast/query-elements/anonymous-query.js +1 -1
  87. package/dist/lang/ast/query-elements/existing-query.d.ts +1 -1
  88. package/dist/lang/ast/query-elements/existing-query.js +11 -11
  89. package/dist/lang/ast/query-elements/full-query.js +11 -11
  90. package/dist/lang/ast/query-elements/query-head-struct.js +1 -1
  91. package/dist/lang/ast/query-items/field-declaration.d.ts +1 -1
  92. package/dist/lang/ast/query-items/field-declaration.js +11 -11
  93. package/dist/lang/ast/query-items/field-references.d.ts +1 -1
  94. package/dist/lang/ast/query-items/field-references.js +1 -1
  95. package/dist/lang/ast/query-properties/filters.d.ts +1 -1
  96. package/dist/lang/ast/query-properties/filters.js +7 -7
  97. package/dist/lang/ast/query-properties/indexing.d.ts +1 -1
  98. package/dist/lang/ast/query-properties/indexing.js +2 -2
  99. package/dist/lang/ast/query-properties/joins.d.ts +1 -1
  100. package/dist/lang/ast/query-properties/joins.js +17 -14
  101. package/dist/lang/ast/query-properties/nest.js +4 -4
  102. package/dist/lang/ast/query-properties/ordering.js +2 -2
  103. package/dist/lang/ast/query-properties/qop-desc.js +1 -1
  104. package/dist/lang/ast/query-properties/top.js +3 -3
  105. package/dist/lang/ast/source-properties/field-list-edit.js +1 -1
  106. package/dist/lang/ast/source-properties/primary-key.js +1 -1
  107. package/dist/lang/ast/source-properties/renames.js +1 -1
  108. package/dist/lang/ast/sources/named-source.d.ts +2 -2
  109. package/dist/lang/ast/sources/named-source.js +6 -6
  110. package/dist/lang/ast/sources/query-source.d.ts +1 -1
  111. package/dist/lang/ast/sources/query-source.js +2 -2
  112. package/dist/lang/ast/sources/table-source.js +7 -5
  113. package/dist/lang/ast/space-seed.d.ts +1 -1
  114. package/dist/lang/ast/sql-elements/sql-statement.js +5 -5
  115. package/dist/lang/ast/sql-elements/sql-string.js +1 -1
  116. package/dist/lang/ast/struct-utils.js +2 -2
  117. package/dist/lang/ast/time-utils.js +32 -32
  118. package/dist/lang/ast/types/expression-def.js +34 -34
  119. package/dist/lang/ast/types/malloy-element.d.ts +4 -4
  120. package/dist/lang/ast/types/malloy-element.js +27 -27
  121. package/dist/lang/ast/types/query-comp.d.ts +1 -1
  122. package/dist/lang/ast/types/space-field.js +1 -1
  123. package/dist/lang/ast/types/space-param.js +2 -2
  124. package/dist/lang/ast/types/turtle-headed-pipe.d.ts +1 -1
  125. package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
  126. package/dist/lang/ast/types/type-desc.d.ts +1 -1
  127. package/dist/lang/field-utils.d.ts +1 -1
  128. package/dist/lang/index.d.ts +1 -1
  129. package/dist/lang/malloy-to-ast.d.ts +1 -1
  130. package/dist/lang/malloy-to-ast.js +11 -11
  131. package/dist/lang/parse-error-handler.js +4 -4
  132. package/dist/lang/parse-malloy.d.ts +4 -4
  133. package/dist/lang/parse-malloy.js +61 -61
  134. package/dist/lang/parse-tree-walkers/document-completion-walker.js +16 -16
  135. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +10 -10
  136. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -82
  137. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
  138. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +1 -1
  139. package/dist/lang/parse-tree-walkers/find-external-references.js +2 -2
  140. package/dist/lang/reference-list.d.ts +1 -1
  141. package/dist/lang/test/document-help-context-walker.spec.js +6 -6
  142. package/dist/lang/test/document-symbol-walker.spec.js +3 -3
  143. package/dist/lang/test/field-symbols.spec.js +62 -58
  144. package/dist/lang/test/parse.spec.js +262 -260
  145. package/dist/lang/test/test-translator.d.ts +1 -1
  146. package/dist/lang/test/test-translator.js +139 -139
  147. package/dist/lang/translate-response.d.ts +1 -1
  148. package/dist/lang/zone.js +5 -5
  149. package/dist/malloy.d.ts +5 -5
  150. package/dist/malloy.js +72 -72
  151. package/dist/model/malloy_query.d.ts +2 -2
  152. package/dist/model/malloy_query.js +179 -176
  153. package/dist/model/malloy_types.js +41 -41
  154. package/dist/model/sql_block.js +2 -2
  155. package/package.json +1 -1
@@ -31,18 +31,18 @@ async function* toAsyncGenerator(startStreaming) {
31
31
  resolve = res;
32
32
  });
33
33
  startStreaming((error) => {
34
- resolve({ done: true, isError: true, error });
34
+ resolve({ "done": true, "isError": true, error });
35
35
  }, (data) => {
36
36
  resolve({
37
- done: false,
38
- value: data,
39
- isError: false,
40
- next: new Promise((res) => {
37
+ "done": false,
38
+ "value": data,
39
+ "isError": false,
40
+ "next": new Promise((res) => {
41
41
  resolve = res;
42
- }),
42
+ })
43
43
  });
44
44
  }, () => {
45
- resolve({ done: true, isError: false });
45
+ resolve({ "done": true, "isError": false });
46
46
  });
47
47
  return promise;
48
48
  }
@@ -1,4 +1,4 @@
1
- import { AtomicFieldType as AtomicFieldTypeInner, TimeFieldType, TimestampUnit, ExtractUnit, DialectFragment, TimeValue, Expr, Sampling, StructDef, TypecastFragment } from "../model/malloy_types";
1
+ import { AtomicFieldType as AtomicFieldTypeInner, DialectFragment, Expr, ExtractUnit, Sampling, StructDef, TimeFieldType, TimeValue, TimestampUnit, TypecastFragment } from "../model/malloy_types";
2
2
  interface DialectField {
3
3
  type: string;
4
4
  sqlExpression: string;
@@ -1,4 +1,4 @@
1
- import { DateUnit, Expr, ExtractUnit, Sampling, StructDef, TimeFieldType, TimestampUnit, TimeValue, TypecastFragment } from "../model/malloy_types";
1
+ import { DateUnit, Expr, ExtractUnit, Sampling, StructDef, TimeFieldType, TimeValue, TimestampUnit, TypecastFragment } from "../model/malloy_types";
2
2
  import { Dialect, DialectFieldList, FunctionInfo } from "./dialect";
3
3
  export declare class DuckDBDialect extends Dialect {
4
4
  name: string;
@@ -108,17 +108,17 @@ WINDOW
108
108
  WITH
109
109
  `.split(/\s/);
110
110
  const castMap = {
111
- number: "double precision",
112
- string: "varchar",
111
+ "number": "double precision",
112
+ "string": "varchar"
113
113
  };
114
114
  const pgExtractionMap = {
115
- day_of_week: "dow",
116
- day_of_year: "doy",
115
+ "day_of_week": "dow",
116
+ "day_of_year": "doy"
117
117
  };
118
118
  const inSeconds = {
119
- second: 1,
120
- minute: 60,
121
- hour: 3600,
119
+ "second": 1,
120
+ "minute": 60,
121
+ "hour": 3600
122
122
  };
123
123
  class DuckDBDialect extends dialect_1.Dialect {
124
124
  constructor() {
@@ -130,13 +130,13 @@ class DuckDBDialect extends dialect_1.Dialect {
130
130
  this.divisionIsInteger = true;
131
131
  this.supportsSumDistinctFunction = true;
132
132
  this.unnestWithNumbers = true;
133
- this.defaultSampling = { rows: 50000 };
133
+ this.defaultSampling = { "rows": 50000 };
134
134
  this.supportUnnestArrayAgg = true;
135
135
  this.supportsCTEinCoorelatedSubQueries = true;
136
136
  this.dontUnionIndex = false;
137
137
  this.supportsQualify = true;
138
138
  this.functionInfo = {
139
- concat: { returnType: "string" },
139
+ "concat": { "returnType": "string" }
140
140
  };
141
141
  }
142
142
  // hack until they support temporary macros.
@@ -1,4 +1,4 @@
1
- import { DateUnit, ExtractUnit, TimeFieldType, TimestampUnit, Expr, TimeValue, TypecastFragment, Sampling } from "../model/malloy_types";
1
+ import { DateUnit, Expr, ExtractUnit, Sampling, TimeFieldType, TimeValue, TimestampUnit, TypecastFragment } from "../model/malloy_types";
2
2
  import { Dialect, DialectFieldList, FunctionInfo } from "./dialect";
3
3
  export declare class PostgresDialect extends Dialect {
4
4
  name: string;
@@ -27,26 +27,26 @@ const utils_1 = require("../model/utils");
27
27
  const malloy_types_1 = require("../model/malloy_types");
28
28
  const dialect_1 = require("./dialect");
29
29
  const castMap = {
30
- number: "double precision",
31
- string: "varchar",
30
+ "number": "double precision",
31
+ "string": "varchar"
32
32
  };
33
33
  const pgExtractionMap = {
34
- day_of_week: "dow",
35
- day_of_year: "doy",
34
+ "day_of_week": "dow",
35
+ "day_of_year": "doy"
36
36
  };
37
37
  const pgMakeIntervalMap = {
38
- year: "years",
39
- month: "months",
40
- week: "weeks",
41
- day: "days",
42
- hour: "hours",
43
- minute: "mins",
44
- second: "secs",
38
+ "year": "years",
39
+ "month": "months",
40
+ "week": "weeks",
41
+ "day": "days",
42
+ "hour": "hours",
43
+ "minute": "mins",
44
+ "second": "secs"
45
45
  };
46
46
  const inSeconds = {
47
- second: 1,
48
- minute: 60,
49
- hour: 3600,
47
+ "second": 1,
48
+ "minute": 60,
49
+ "hour": 3600
50
50
  };
51
51
  class PostgresDialect extends dialect_1.Dialect {
52
52
  constructor() {
@@ -59,13 +59,13 @@ class PostgresDialect extends dialect_1.Dialect {
59
59
  this.divisionIsInteger = true;
60
60
  this.supportsSumDistinctFunction = false;
61
61
  this.unnestWithNumbers = false;
62
- this.defaultSampling = { rows: 50000 };
62
+ this.defaultSampling = { "rows": 50000 };
63
63
  this.supportUnnestArrayAgg = true;
64
64
  this.supportsCTEinCoorelatedSubQueries = true;
65
65
  this.dontUnionIndex = false;
66
66
  this.supportsQualify = false;
67
67
  this.functionInfo = {
68
- concat: { returnType: "string" },
68
+ "concat": { "returnType": "string" }
69
69
  };
70
70
  }
71
71
  quoteTablePath(tablePath) {
@@ -1,4 +1,4 @@
1
- import { TimestampUnit, ExtractUnit, Expr, TimeValue, TypecastFragment, Sampling } from "../model/malloy_types";
1
+ import { Expr, ExtractUnit, Sampling, TimeValue, TimestampUnit, TypecastFragment } from "../model/malloy_types";
2
2
  import { Dialect, DialectFieldList, FunctionInfo } from "./dialect";
3
3
  export declare class StandardSQLDialect extends Dialect {
4
4
  name: string;
@@ -27,7 +27,7 @@ const utils_1 = require("../model/utils");
27
27
  const malloy_types_1 = require("../model/malloy_types");
28
28
  const dialect_1 = require("./dialect");
29
29
  const castMap = {
30
- number: "float64",
30
+ "number": "float64"
31
31
  };
32
32
  // These are the units that "TIMESTAMP_ADD" accepts
33
33
  const timestampAddUnits = [
@@ -36,11 +36,11 @@ const timestampAddUnits = [
36
36
  "second",
37
37
  "minute",
38
38
  "hour",
39
- "day",
39
+ "day"
40
40
  ];
41
41
  const extractMap = {
42
- day_of_week: "dayofweek",
43
- day_of_year: "dayofyear",
42
+ "day_of_week": "dayofweek",
43
+ "day_of_year": "dayofyear"
44
44
  };
45
45
  class StandardSQLDialect extends dialect_1.Dialect {
46
46
  constructor() {
@@ -53,17 +53,17 @@ class StandardSQLDialect extends dialect_1.Dialect {
53
53
  this.divisionIsInteger = false;
54
54
  this.supportsSumDistinctFunction = false;
55
55
  this.unnestWithNumbers = false;
56
- this.defaultSampling = { enable: false };
56
+ this.defaultSampling = { "enable": false };
57
57
  this.supportUnnestArrayAgg = false;
58
58
  this.supportsCTEinCoorelatedSubQueries = false;
59
59
  this.dontUnionIndex = true; // bigquery can't use a sample table more than once in a query.
60
60
  this.supportsQualify = true;
61
61
  // I think we want an optional list of parameters types that we force a cast to.
62
62
  this.functionInfo = {
63
- timestamp_seconds: {
64
- returnType: "timestamp",
63
+ "timestamp_seconds": {
64
+ "returnType": "timestamp"
65
65
  },
66
- concat: { returnType: "string" },
66
+ "concat": { "returnType": "string" }
67
67
  };
68
68
  this.keywords = `
69
69
  ALL
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export type { QueryDataRow, Fragment, StructDef, StructRelationship, NamedStructDefs, MalloyQueryData, AtomicFieldType as AtomicFieldTypeInner, DateUnit, ExtractUnit, TimestampUnit, TimeFieldType, QueryData, FieldTypeDef, Expr, DialectFragment, TimeValue, FilterExpression, SQLBlock, FieldDef, FilteredAliasedName, PipeSegment, QueryFieldDef, TurtleDef, SearchValueMapResult, SearchIndexResult, ModelDef, Query, NamedQuery, NamedModelObject, ExpressionType, } from "./model";
2
- export { Segment, isFilteredAliasedName, flattenQuery, expressionIsCalculation, } from "./model";
3
- export { HighlightType, MalloyTranslator, } from "./lang";
1
+ export type { QueryDataRow, Fragment, StructDef, StructRelationship, NamedStructDefs, MalloyQueryData, AtomicFieldType as AtomicFieldTypeInner, DateUnit, ExtractUnit, TimestampUnit, TimeFieldType, QueryData, FieldTypeDef, Expr, DialectFragment, TimeValue, FilterExpression, SQLBlock, FieldDef, FilteredAliasedName, PipeSegment, QueryFieldDef, TurtleDef, SearchValueMapResult, SearchIndexResult, ModelDef, Query, NamedQuery, NamedModelObject, ExpressionType } from "./model";
2
+ export { Segment, isFilteredAliasedName, flattenQuery, expressionIsCalculation } from "./model";
3
+ export { HighlightType, MalloyTranslator } from "./lang";
4
4
  export type { LogMessage, TranslateResponse } from "./lang";
5
- export { Malloy, Runtime, AtomicFieldType, ConnectionRuntime, SingleConnectionRuntime, EmptyURLReader, InMemoryURLReader, FixedConnectionMap, MalloyError, JoinRelationship, SourceRelationship, DateTimeframe, TimestampTimeframe, Result, parseTableURI, QueryMaterializer, CSVWriter, JSONWriter, DataWriter, } from "./malloy";
6
- export type { Explore, Model, PreparedQuery, PreparedResult, Field, AtomicField, ExploreField, QueryField, DataArray, DataRecord, DataColumn, DataArrayOrRecord, ModelMaterializer, DocumentSymbol, DocumentHighlight, ResultJSON, PreparedResultMaterializer, SQLBlockMaterializer, ExploreMaterializer, WriteStream, } from "./malloy";
5
+ export { Malloy, Runtime, AtomicFieldType, ConnectionRuntime, SingleConnectionRuntime, EmptyURLReader, InMemoryURLReader, FixedConnectionMap, MalloyError, JoinRelationship, SourceRelationship, DateTimeframe, TimestampTimeframe, Result, parseTableURI, QueryMaterializer, CSVWriter, JSONWriter, DataWriter } from "./malloy";
6
+ export type { Explore, Model, PreparedQuery, PreparedResult, Field, AtomicField, ExploreField, QueryField, DataArray, DataRecord, DataColumn, DataArrayOrRecord, ModelMaterializer, DocumentSymbol, DocumentHighlight, ResultJSON, PreparedResultMaterializer, SQLBlockMaterializer, ExploreMaterializer, WriteStream } from "./malloy";
7
7
  export type { RunSQLOptions } from "./run_sql_options";
8
- export type { URLReader, InfoConnection, LookupConnection, Connection, QueryString, ModelString, QueryURL, ModelURL, PooledConnection, TestableConnection, PersistSQLResults, StreamingConnection, } from "./runtime_types";
8
+ export type { URLReader, InfoConnection, LookupConnection, Connection, QueryString, ModelString, QueryURL, ModelURL, PooledConnection, TestableConnection, PersistSQLResults, StreamingConnection } from "./runtime_types";
9
9
  export type { Loggable } from "./malloy";
10
10
  export { toAsyncGenerator } from "./connection_utils";
@@ -33,9 +33,9 @@ exports.errorFor = void 0;
33
33
  */
34
34
  function errorFor(reason) {
35
35
  return {
36
- dataType: "unknown",
37
- expressionType: "scalar",
38
- value: [`_ERROR_${reason.replace(/ /g, "_")}`],
36
+ "dataType": "unknown",
37
+ "expressionType": "scalar",
38
+ "value": [`_ERROR_${reason.replace(/ /g, "_")}`]
39
39
  };
40
40
  }
41
41
  exports.errorFor = errorFor;
@@ -26,7 +26,7 @@ exports.DefineQueryList = exports.DefineQuery = void 0;
26
26
  const malloy_element_1 = require("../types/malloy-element");
27
27
  class DefineQuery extends malloy_element_1.MalloyElement {
28
28
  constructor(name, queryDetails) {
29
- super({ queryDetails });
29
+ super({ "queryDetails": queryDetails });
30
30
  this.name = name;
31
31
  this.queryDetails = queryDetails;
32
32
  this.elementType = "defineQuery";
@@ -34,9 +34,9 @@ class DefineQuery extends malloy_element_1.MalloyElement {
34
34
  execute(doc) {
35
35
  const entry = {
36
36
  ...this.queryDetails.query(),
37
- type: "query",
38
- name: this.name,
39
- location: this.location,
37
+ "type": "query",
38
+ "name": this.name,
39
+ "location": this.location
40
40
  };
41
41
  const exported = false;
42
42
  doc.setEntry(this.name, { entry, exported });
@@ -1,6 +1,6 @@
1
1
  import { ModelDataRequest } from "../../translate-response";
2
- import { DocStatement, Document, MalloyElement, RunList } from "../types/malloy-element";
3
2
  import { HasParameter } from "../parameters/has-parameter";
3
+ import { DocStatement, Document, MalloyElement, RunList } from "../types/malloy-element";
4
4
  import { Source } from "./source";
5
5
  export declare class DefineSource extends MalloyElement implements DocStatement {
6
6
  readonly name: string;
@@ -23,12 +23,12 @@
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.DefineSourceList = exports.DefineSource = void 0;
26
- const malloy_element_1 = require("../types/malloy-element");
27
- const has_parameter_1 = require("../parameters/has-parameter");
28
26
  const error_factory_1 = require("../error-factory");
27
+ const has_parameter_1 = require("../parameters/has-parameter");
28
+ const malloy_element_1 = require("../types/malloy-element");
29
29
  class DefineSource extends malloy_element_1.MalloyElement {
30
30
  constructor(name, theSource, exported, params) {
31
- super({ explore: theSource });
31
+ super({ "explore": theSource });
32
32
  this.name = name;
33
33
  this.theSource = theSource;
34
34
  this.exported = exported;
@@ -43,7 +43,7 @@ class DefineSource extends malloy_element_1.MalloyElement {
43
43
  this.log(`Unexpected element type in define statement: ${el.elementType}`);
44
44
  }
45
45
  }
46
- this.has({ parameters: this.parameters });
46
+ this.has({ "parameters": this.parameters });
47
47
  }
48
48
  }
49
49
  execute(doc) {
@@ -56,12 +56,12 @@ class DefineSource extends malloy_element_1.MalloyElement {
56
56
  return;
57
57
  }
58
58
  doc.setEntry(this.name, {
59
- entry: {
59
+ "entry": {
60
60
  ...structDef,
61
- as: this.name,
62
- location: this.location,
61
+ "as": this.name,
62
+ "location": this.location
63
63
  },
64
- exported: this.exported,
64
+ "exported": this.exported
65
65
  });
66
66
  }
67
67
  }
@@ -59,8 +59,8 @@ class ImportStatement extends malloy_element_1.MalloyElement {
59
59
  const importStructs = trans.getChildExports(this.fullURL);
60
60
  for (const importing in importStructs) {
61
61
  doc.setEntry(importing, {
62
- entry: importStructs[importing],
63
- exported: false,
62
+ "entry": importStructs[importing],
63
+ "exported": false
64
64
  });
65
65
  }
66
66
  }
@@ -1,4 +1,4 @@
1
- import { DocumentLocation, Pipeline, PipeSegment, StructDef } from "../../../model/malloy_types";
1
+ import { DocumentLocation, PipeSegment, Pipeline, StructDef } from "../../../model/malloy_types";
2
2
  import { FieldSpace } from "../types/field-space";
3
3
  import { MalloyElement } from "../types/malloy-element";
4
4
  import { QOPDesc } from "../query-properties/qop-desc";
@@ -38,11 +38,11 @@ class PipelineDesc extends malloy_element_1.MalloyElement {
38
38
  }
39
39
  refineHead(refinement) {
40
40
  this.headRefinement = refinement;
41
- this.has({ headRefinement: refinement });
41
+ this.has({ "headRefinement": refinement });
42
42
  }
43
43
  addSegments(...segDesc) {
44
44
  this.qops.push(...segDesc);
45
- this.has({ segments: this.qops });
45
+ this.has({ "segments": this.qops });
46
46
  }
47
47
  appendOps(modelPipe, existingEndSpace) {
48
48
  let nextFS = existingEndSpace;
@@ -57,8 +57,8 @@ class PipelineDesc extends malloy_element_1.MalloyElement {
57
57
  nextFS = next.outputSpace();
58
58
  }
59
59
  return {
60
- opList: returnPipe || modelPipe,
61
- structDef: nextFS.structDef(),
60
+ "opList": returnPipe || modelPipe,
61
+ "structDef": nextFS.structDef()
62
62
  };
63
63
  }
64
64
  refinePipeline(fs, modelPipe) {
@@ -67,7 +67,7 @@ class PipelineDesc extends malloy_element_1.MalloyElement {
67
67
  }
68
68
  const pipeline = [];
69
69
  if (modelPipe.pipeHead) {
70
- const { pipeline: turtlePipe } = this.expandTurtle(modelPipe.pipeHead.name, fs.structDef());
70
+ const { "pipeline": turtlePipe } = this.expandTurtle(modelPipe.pipeHead.name, fs.structDef());
71
71
  pipeline.push(...turtlePipe);
72
72
  }
73
73
  pipeline.push(...modelPipe.pipeline);
@@ -87,9 +87,9 @@ class PipelineDesc extends malloy_element_1.MalloyElement {
87
87
  this.log(`'${turtleName}' is not a query`);
88
88
  }
89
89
  else {
90
- return { pipeline: turtle.pipeline, location: turtle.location };
90
+ return { "pipeline": turtle.pipeline, "location": turtle.location };
91
91
  }
92
- return { pipeline: [], location: undefined };
92
+ return { "pipeline": [], "location": undefined };
93
93
  }
94
94
  getOutputStruct(walkStruct, pipeline) {
95
95
  for (const modelQop of pipeline) {
@@ -1,6 +1,6 @@
1
1
  import { StructDef } from "../../../model/malloy_types";
2
- import { ExploreDesc } from "../types/explore-desc";
3
2
  import { HasParameter } from "../parameters/has-parameter";
3
+ import { ExploreDesc } from "../types/explore-desc";
4
4
  import { Source } from "./source";
5
5
  /**
6
6
  * A Source made from a source reference and a set of refinements
@@ -25,21 +25,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.RefinedSource = void 0;
26
26
  const lodash_1 = require("lodash");
27
27
  const malloy_types_1 = require("../../../model/malloy_types");
28
+ const refined_space_1 = require("../field-space/refined-space");
29
+ const declare_fields_1 = require("../query-properties/declare-fields");
30
+ const filters_1 = require("../query-properties/filters");
31
+ const joins_1 = require("../query-properties/joins");
28
32
  const field_list_edit_1 = require("../source-properties/field-list-edit");
29
33
  const primary_key_1 = require("../source-properties/primary-key");
30
34
  const renames_1 = require("../source-properties/renames");
31
35
  const turtles_1 = require("../source-properties/turtles");
32
36
  const source_1 = require("./source");
33
- const declare_fields_1 = require("../query-properties/declare-fields");
34
- const filters_1 = require("../query-properties/filters");
35
- const joins_1 = require("../query-properties/joins");
36
- const refined_space_1 = require("../field-space/refined-space");
37
37
  /**
38
38
  * A Source made from a source reference and a set of refinements
39
39
  */
40
40
  class RefinedSource extends source_1.Source {
41
41
  constructor(source, refinement) {
42
- super({ source, refinement });
42
+ super({ "source": source, "refinement": refinement });
43
43
  this.source = source;
44
44
  this.refinement = refinement;
45
45
  this.elementType = "refinedSource";
@@ -43,7 +43,7 @@ class Source extends malloy_element_1.MalloyElement {
43
43
  }
44
44
  return {
45
45
  ...before,
46
- parameters,
46
+ parameters
47
47
  };
48
48
  }
49
49
  return before;
@@ -24,15 +24,18 @@
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.ErrorFactory = void 0;
26
26
  const theErrorStruct = {
27
- type: "struct",
28
- name: "~malformed~",
29
- dialect: "~malformed~",
30
- structSource: { type: "table", tablePath: "//undefined_error_table_path" },
31
- structRelationship: {
32
- type: "basetable",
33
- connectionName: "//undefined_error_connection",
27
+ "type": "struct",
28
+ "name": "~malformed~",
29
+ "dialect": "~malformed~",
30
+ "structSource": {
31
+ "type": "table",
32
+ "tablePath": "//undefined_error_table_path"
34
33
  },
35
- fields: [],
34
+ "structRelationship": {
35
+ "type": "basetable",
36
+ "connectionName": "//undefined_error_connection"
37
+ },
38
+ "fields": []
36
39
  };
37
40
  class ErrorFactory {
38
41
  static get structDef() {
@@ -43,18 +46,18 @@ class ErrorFactory {
43
46
  }
44
47
  static get query() {
45
48
  return {
46
- structRef: ErrorFactory.structDef,
47
- pipeline: [],
49
+ "structRef": ErrorFactory.structDef,
50
+ "pipeline": []
48
51
  };
49
52
  }
50
53
  static get reduceSegment() {
51
- return { type: "reduce", fields: [] };
54
+ return { "type": "reduce", "fields": [] };
52
55
  }
53
56
  static get projectSegment() {
54
- return { type: "project", fields: [] };
57
+ return { "type": "project", "fields": [] };
55
58
  }
56
59
  static get indexSegment() {
57
- return { type: "index", fields: [] };
60
+ return { "type": "index", "fields": [] };
58
61
  }
59
62
  }
60
63
  exports.ErrorFactory = ErrorFactory;
@@ -1,6 +1,6 @@
1
- import { FieldSpace } from "../types/field-space";
2
1
  import { ExprValue } from "../types/expr-value";
3
2
  import { ExpressionDef } from "../types/expression-def";
3
+ import { FieldSpace } from "../types/field-space";
4
4
  export declare abstract class BinaryBoolean<opType extends string> extends ExpressionDef {
5
5
  readonly left: ExpressionDef;
6
6
  readonly op: opType;
@@ -30,7 +30,7 @@ const expression_def_1 = require("../types/expression-def");
30
30
  const utils_1 = require("./utils");
31
31
  class BinaryBoolean extends expression_def_1.ExpressionDef {
32
32
  constructor(left, op, right) {
33
- super({ left, right });
33
+ super({ "left": left, "right": right });
34
34
  this.left = left;
35
35
  this.op = op;
36
36
  this.right = right;
@@ -42,9 +42,9 @@ class BinaryBoolean extends expression_def_1.ExpressionDef {
42
42
  const right = this.right.getExpression(fs);
43
43
  if (this.typeCheck(this.left, left) && this.typeCheck(this.right, right)) {
44
44
  return {
45
- dataType: "boolean",
46
- expressionType: (0, malloy_types_1.maxExpressionType)(left.expressionType, right.expressionType),
47
- value: (0, utils_1.compose)(left.value, this.op, right.value),
45
+ "dataType": "boolean",
46
+ "expressionType": (0, malloy_types_1.maxExpressionType)(left.expressionType, right.expressionType),
47
+ "value": (0, utils_1.compose)(left.value, this.op, right.value)
48
48
  };
49
49
  }
50
50
  return (0, ast_utils_1.errorFor)("logial required boolean");
@@ -1,6 +1,6 @@
1
1
  import { ExprValue } from "../types/expr-value";
2
- import { FieldSpace } from "../types/field-space";
3
2
  import { ExpressionDef } from "../types/expression-def";
3
+ import { FieldSpace } from "../types/field-space";
4
4
  export declare abstract class BinaryNumeric<opType extends string> extends ExpressionDef {
5
5
  readonly left: ExpressionDef;
6
6
  readonly op: opType;
@@ -27,7 +27,7 @@ const fragtype_utils_1 = require("../fragtype-utils");
27
27
  const expression_def_1 = require("../types/expression-def");
28
28
  class BinaryNumeric extends expression_def_1.ExpressionDef {
29
29
  constructor(left, op, right) {
30
- super({ left, right });
30
+ super({ "left": left, "right": right });
31
31
  this.left = left;
32
32
  this.op = op;
33
33
  this.right = right;
@@ -32,7 +32,7 @@ class Boolean extends expression_def_1.ExpressionDef {
32
32
  this.elementType = "boolean literal";
33
33
  }
34
34
  getExpression() {
35
- return { ...fragtype_utils_1.FT.boolT, value: [this.value] };
35
+ return { ...fragtype_utils_1.FT.boolT, "value": [this.value] };
36
36
  }
37
37
  }
38
38
  exports.Boolean = Boolean;
@@ -24,8 +24,8 @@
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.ConstantSubExpression = void 0;
26
26
  const comparison_1 = require("../types/comparison");
27
- const expr_compare_1 = require("./expr-compare");
28
27
  const expression_def_1 = require("../types/expression-def");
28
+ const expr_compare_1 = require("./expr-compare");
29
29
  const utils_1 = require("./utils");
30
30
  class ConstantFieldSpace {
31
31
  constructor() {
@@ -39,8 +39,8 @@ class ConstantFieldSpace {
39
39
  }
40
40
  lookup(_name) {
41
41
  return {
42
- error: "Only constants allowed in parameter expressions",
43
- found: undefined,
42
+ "error": "Only constants allowed in parameter expressions",
43
+ "found": undefined
44
44
  };
45
45
  }
46
46
  dialectObj() {
@@ -58,9 +58,9 @@ class DollarReference extends expression_def_1.ExpressionDef {
58
58
  }
59
59
  getExpression(_fs) {
60
60
  return {
61
- dataType: this.refType,
62
- value: [{ type: "applyVal" }],
63
- expressionType: "scalar",
61
+ "dataType": this.refType,
62
+ "value": [{ "type": "applyVal" }],
63
+ "expressionType": "scalar"
64
64
  };
65
65
  }
66
66
  }
@@ -85,7 +85,7 @@ class ConstantSubExpression extends expression_def_1.ExpressionDef {
85
85
  constantCondition(type) {
86
86
  const compareAndContrast = new expr_compare_1.ExprCompare(new DollarReference(type), comparison_1.Comparison.EqualTo, this.expr);
87
87
  const application = compareAndContrast.getExpression(this.constantFs);
88
- return { ...application, value: (0, utils_1.compressExpr)(application.value) };
88
+ return { ...application, "value": (0, utils_1.compressExpr)(application.value) };
89
89
  }
90
90
  apply(fs, op, expr) {
91
91
  return this.expr.apply(fs, op, expr);
@@ -1,8 +1,8 @@
1
- import { ExprValue } from "../types/expr-value";
2
- import { FieldValueType } from "../types/type-desc";
3
1
  import { FieldReference } from "../query-items/field-references";
4
- import { FieldSpace } from "../types/field-space";
2
+ import { ExprValue } from "../types/expr-value";
5
3
  import { ExpressionDef } from "../types/expression-def";
4
+ import { FieldSpace } from "../types/field-space";
5
+ import { FieldValueType } from "../types/type-desc";
6
6
  export declare abstract class ExprAggregateFunction extends ExpressionDef {
7
7
  readonly func: string;
8
8
  elementType: string;