@malloydata/malloy 0.0.24-dev230224184907 → 0.0.24-dev230228224434

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 (310) hide show
  1. package/dist/connection_utils.js +10 -10
  2. package/dist/dialect/dialect.d.ts +2 -2
  3. package/dist/dialect/dialect.js +13 -13
  4. package/dist/dialect/dialect_map.d.ts +1 -1
  5. package/dist/dialect/duckdb.d.ts +3 -3
  6. package/dist/dialect/duckdb.js +44 -44
  7. package/dist/dialect/index.d.ts +6 -6
  8. package/dist/dialect/postgres.d.ts +3 -3
  9. package/dist/dialect/postgres.js +46 -46
  10. package/dist/dialect/standardsql.d.ts +4 -4
  11. package/dist/dialect/standardsql.js +51 -51
  12. package/dist/index.d.ts +10 -10
  13. package/dist/lang/ast/ast-utils.d.ts +1 -1
  14. package/dist/lang/ast/ast-utils.js +3 -3
  15. package/dist/lang/ast/elements/define-query.d.ts +3 -3
  16. package/dist/lang/ast/elements/define-query.js +6 -6
  17. package/dist/lang/ast/elements/define-source.d.ts +4 -4
  18. package/dist/lang/ast/elements/define-source.js +8 -8
  19. package/dist/lang/ast/elements/import-statement.d.ts +2 -2
  20. package/dist/lang/ast/elements/import-statement.js +7 -7
  21. package/dist/lang/ast/elements/pipeline-desc.d.ts +5 -5
  22. package/dist/lang/ast/elements/pipeline-desc.js +11 -11
  23. package/dist/lang/ast/elements/refined-source.d.ts +4 -4
  24. package/dist/lang/ast/elements/refined-source.js +6 -6
  25. package/dist/lang/ast/elements/source.d.ts +3 -3
  26. package/dist/lang/ast/elements/source.js +1 -1
  27. package/dist/lang/ast/error-factory.d.ts +1 -1
  28. package/dist/lang/ast/error-factory.js +15 -15
  29. package/dist/lang/ast/executors/index-executor.d.ts +7 -7
  30. package/dist/lang/ast/executors/index-executor.js +4 -4
  31. package/dist/lang/ast/executors/project-executor.d.ts +5 -5
  32. package/dist/lang/ast/executors/project-executor.js +2 -2
  33. package/dist/lang/ast/executors/reduce-executor.d.ts +8 -8
  34. package/dist/lang/ast/executors/reduce-executor.js +5 -5
  35. package/dist/lang/ast/expressions/apply.d.ts +2 -2
  36. package/dist/lang/ast/expressions/apply.js +1 -1
  37. package/dist/lang/ast/expressions/binary-boolean.d.ts +3 -3
  38. package/dist/lang/ast/expressions/binary-boolean.js +6 -6
  39. package/dist/lang/ast/expressions/binary-numeric.d.ts +3 -3
  40. package/dist/lang/ast/expressions/binary-numeric.js +2 -2
  41. package/dist/lang/ast/expressions/boolean.d.ts +4 -4
  42. package/dist/lang/ast/expressions/boolean.js +2 -2
  43. package/dist/lang/ast/expressions/constant-sub-expression.d.ts +4 -4
  44. package/dist/lang/ast/expressions/constant-sub-expression.js +12 -12
  45. package/dist/lang/ast/expressions/expr-add-sub.d.ts +2 -2
  46. package/dist/lang/ast/expressions/expr-add-sub.js +1 -1
  47. package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +5 -5
  48. package/dist/lang/ast/expressions/expr-aggregate-function.js +15 -15
  49. package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +6 -6
  50. package/dist/lang/ast/expressions/expr-alternation-tree.js +6 -6
  51. package/dist/lang/ast/expressions/expr-asymmetric.d.ts +5 -5
  52. package/dist/lang/ast/expressions/expr-asymmetric.js +3 -3
  53. package/dist/lang/ast/expressions/expr-avg.d.ts +3 -3
  54. package/dist/lang/ast/expressions/expr-avg.js +2 -2
  55. package/dist/lang/ast/expressions/expr-cast.d.ts +4 -4
  56. package/dist/lang/ast/expressions/expr-cast.js +6 -6
  57. package/dist/lang/ast/expressions/expr-compare.d.ts +5 -5
  58. package/dist/lang/ast/expressions/expr-compare.js +9 -9
  59. package/dist/lang/ast/expressions/expr-count-distinct.d.ts +2 -2
  60. package/dist/lang/ast/expressions/expr-count-distinct.js +1 -1
  61. package/dist/lang/ast/expressions/expr-count.d.ts +4 -4
  62. package/dist/lang/ast/expressions/expr-count.js +10 -10
  63. package/dist/lang/ast/expressions/expr-filter.d.ts +4 -4
  64. package/dist/lang/ast/expressions/expr-filter.js +13 -13
  65. package/dist/lang/ast/expressions/expr-func.d.ts +3 -3
  66. package/dist/lang/ast/expressions/expr-func.js +8 -8
  67. package/dist/lang/ast/expressions/expr-granular-time.d.ts +4 -4
  68. package/dist/lang/ast/expressions/expr-granular-time.js +17 -17
  69. package/dist/lang/ast/expressions/expr-id-reference.d.ts +4 -4
  70. package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
  71. package/dist/lang/ast/expressions/expr-logical-op.d.ts +2 -2
  72. package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
  73. package/dist/lang/ast/expressions/expr-max.d.ts +4 -4
  74. package/dist/lang/ast/expressions/expr-max.js +1 -1
  75. package/dist/lang/ast/expressions/expr-min.d.ts +4 -4
  76. package/dist/lang/ast/expressions/expr-min.js +1 -1
  77. package/dist/lang/ast/expressions/expr-minus.d.ts +3 -3
  78. package/dist/lang/ast/expressions/expr-minus.js +5 -5
  79. package/dist/lang/ast/expressions/expr-mul-div.d.ts +2 -2
  80. package/dist/lang/ast/expressions/expr-mul-div.js +1 -1
  81. package/dist/lang/ast/expressions/expr-not.d.ts +4 -4
  82. package/dist/lang/ast/expressions/expr-not.js +3 -3
  83. package/dist/lang/ast/expressions/expr-now.d.ts +3 -3
  84. package/dist/lang/ast/expressions/expr-now.js +8 -8
  85. package/dist/lang/ast/expressions/expr-null.d.ts +2 -2
  86. package/dist/lang/ast/expressions/expr-null.js +4 -4
  87. package/dist/lang/ast/expressions/expr-number.d.ts +3 -3
  88. package/dist/lang/ast/expressions/expr-number.js +2 -2
  89. package/dist/lang/ast/expressions/expr-parens.d.ts +3 -3
  90. package/dist/lang/ast/expressions/expr-parens.js +3 -3
  91. package/dist/lang/ast/expressions/expr-regex.d.ts +2 -2
  92. package/dist/lang/ast/expressions/expr-regex.js +4 -4
  93. package/dist/lang/ast/expressions/expr-string.d.ts +3 -3
  94. package/dist/lang/ast/expressions/expr-string.js +8 -8
  95. package/dist/lang/ast/expressions/expr-sum.d.ts +3 -3
  96. package/dist/lang/ast/expressions/expr-sum.js +2 -2
  97. package/dist/lang/ast/expressions/expr-time-extract.d.ts +4 -4
  98. package/dist/lang/ast/expressions/expr-time-extract.js +30 -30
  99. package/dist/lang/ast/expressions/expr-time.d.ts +4 -4
  100. package/dist/lang/ast/expressions/expr-time.js +10 -10
  101. package/dist/lang/ast/expressions/expr-ungroup.d.ts +6 -6
  102. package/dist/lang/ast/expressions/expr-ungroup.js +13 -13
  103. package/dist/lang/ast/expressions/for-range.d.ts +4 -4
  104. package/dist/lang/ast/expressions/for-range.js +17 -17
  105. package/dist/lang/ast/expressions/granular-literal.d.ts +4 -4
  106. package/dist/lang/ast/expressions/granular-literal.js +34 -34
  107. package/dist/lang/ast/expressions/partial-compare.d.ts +4 -4
  108. package/dist/lang/ast/expressions/partial-compare.js +4 -4
  109. package/dist/lang/ast/expressions/pick-when.d.ts +4 -4
  110. package/dist/lang/ast/expressions/pick-when.js +32 -32
  111. package/dist/lang/ast/expressions/range.d.ts +3 -3
  112. package/dist/lang/ast/expressions/range.js +20 -20
  113. package/dist/lang/ast/expressions/time-frame.d.ts +2 -2
  114. package/dist/lang/ast/expressions/time-frame.js +3 -3
  115. package/dist/lang/ast/expressions/top-by.d.ts +4 -4
  116. package/dist/lang/ast/expressions/top-by.js +5 -5
  117. package/dist/lang/ast/expressions/unary.d.ts +1 -1
  118. package/dist/lang/ast/expressions/unary.js +1 -1
  119. package/dist/lang/ast/expressions/utils.d.ts +2 -2
  120. package/dist/lang/ast/expressions/utils.js +6 -6
  121. package/dist/lang/ast/field-space/column-space-field.d.ts +3 -3
  122. package/dist/lang/ast/field-space/dynamic-space.d.ts +7 -7
  123. package/dist/lang/ast/field-space/dynamic-space.js +2 -2
  124. package/dist/lang/ast/field-space/field-definition-value.d.ts +5 -5
  125. package/dist/lang/ast/field-space/index-field-space.d.ts +3 -3
  126. package/dist/lang/ast/field-space/index-field-space.js +4 -4
  127. package/dist/lang/ast/field-space/join-space-field.d.ts +3 -3
  128. package/dist/lang/ast/field-space/project-field-space.d.ts +2 -2
  129. package/dist/lang/ast/field-space/project-field-space.js +5 -5
  130. package/dist/lang/ast/field-space/query-field-struct.d.ts +3 -3
  131. package/dist/lang/ast/field-space/query-field-struct.js +1 -1
  132. package/dist/lang/ast/field-space/query-space-field.d.ts +4 -4
  133. package/dist/lang/ast/field-space/query-space-field.js +1 -1
  134. package/dist/lang/ast/field-space/query-spaces.d.ts +11 -11
  135. package/dist/lang/ast/field-space/query-spaces.js +8 -8
  136. package/dist/lang/ast/field-space/reference-field.d.ts +5 -5
  137. package/dist/lang/ast/field-space/reference-field.js +1 -1
  138. package/dist/lang/ast/field-space/refined-space.d.ts +4 -4
  139. package/dist/lang/ast/field-space/refined-space.js +2 -2
  140. package/dist/lang/ast/field-space/rename-space-field.d.ts +3 -3
  141. package/dist/lang/ast/field-space/rename-space-field.js +2 -2
  142. package/dist/lang/ast/field-space/static-space.d.ts +7 -7
  143. package/dist/lang/ast/field-space/static-space.js +12 -12
  144. package/dist/lang/ast/field-space/struct-space-field-base.d.ts +4 -4
  145. package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
  146. package/dist/lang/ast/field-space/wild-space-field.d.ts +4 -4
  147. package/dist/lang/ast/field-space/wild-space-field.js +1 -1
  148. package/dist/lang/ast/fragtype-utils.d.ts +1 -1
  149. package/dist/lang/ast/fragtype-utils.js +15 -15
  150. package/dist/lang/ast/index.d.ts +90 -90
  151. package/dist/lang/ast/parameters/constant-parameter.d.ts +3 -3
  152. package/dist/lang/ast/parameters/constant-parameter.js +10 -10
  153. package/dist/lang/ast/parameters/has-parameter.d.ts +3 -3
  154. package/dist/lang/ast/parameters/has-parameter.js +7 -7
  155. package/dist/lang/ast/query-elements/anonymous-query.d.ts +3 -3
  156. package/dist/lang/ast/query-elements/anonymous-query.js +2 -2
  157. package/dist/lang/ast/query-elements/existing-query.d.ts +4 -4
  158. package/dist/lang/ast/query-elements/existing-query.js +10 -10
  159. package/dist/lang/ast/query-elements/full-query.d.ts +4 -4
  160. package/dist/lang/ast/query-elements/full-query.js +10 -10
  161. package/dist/lang/ast/query-elements/query-head-struct.d.ts +2 -2
  162. package/dist/lang/ast/query-elements/query-head-struct.js +2 -2
  163. package/dist/lang/ast/query-items/field-declaration.d.ts +6 -6
  164. package/dist/lang/ast/query-items/field-declaration.js +14 -14
  165. package/dist/lang/ast/query-items/field-references.d.ts +6 -6
  166. package/dist/lang/ast/query-items/field-references.js +9 -9
  167. package/dist/lang/ast/query-properties/aggregate.d.ts +2 -2
  168. package/dist/lang/ast/query-properties/aggregate.js +1 -1
  169. package/dist/lang/ast/query-properties/declare-fields.d.ts +2 -2
  170. package/dist/lang/ast/query-properties/declare-fields.js +1 -1
  171. package/dist/lang/ast/query-properties/dimmensions.d.ts +2 -2
  172. package/dist/lang/ast/query-properties/dimmensions.js +1 -1
  173. package/dist/lang/ast/query-properties/filters.d.ts +4 -4
  174. package/dist/lang/ast/query-properties/filters.js +16 -16
  175. package/dist/lang/ast/query-properties/group-by.d.ts +2 -2
  176. package/dist/lang/ast/query-properties/group-by.js +1 -1
  177. package/dist/lang/ast/query-properties/indexing.d.ts +3 -3
  178. package/dist/lang/ast/query-properties/indexing.js +3 -3
  179. package/dist/lang/ast/query-properties/joins.d.ts +6 -6
  180. package/dist/lang/ast/query-properties/joins.js +27 -27
  181. package/dist/lang/ast/query-properties/limit.d.ts +1 -1
  182. package/dist/lang/ast/query-properties/limit.js +1 -1
  183. package/dist/lang/ast/query-properties/measures.d.ts +2 -2
  184. package/dist/lang/ast/query-properties/measures.js +1 -1
  185. package/dist/lang/ast/query-properties/nest-reference.d.ts +2 -2
  186. package/dist/lang/ast/query-properties/nest-reference.js +1 -1
  187. package/dist/lang/ast/query-properties/nest.d.ts +7 -7
  188. package/dist/lang/ast/query-properties/nest.js +7 -7
  189. package/dist/lang/ast/query-properties/nests.d.ts +2 -2
  190. package/dist/lang/ast/query-properties/nests.js +1 -1
  191. package/dist/lang/ast/query-properties/ordering.d.ts +3 -3
  192. package/dist/lang/ast/query-properties/ordering.js +6 -6
  193. package/dist/lang/ast/query-properties/project-statement.d.ts +2 -2
  194. package/dist/lang/ast/query-properties/project-statement.js +1 -1
  195. package/dist/lang/ast/query-properties/qop-desc.d.ts +7 -7
  196. package/dist/lang/ast/query-properties/qop-desc.js +20 -20
  197. package/dist/lang/ast/query-properties/sampling.d.ts +2 -2
  198. package/dist/lang/ast/query-properties/sampling.js +1 -1
  199. package/dist/lang/ast/query-properties/top.d.ts +4 -4
  200. package/dist/lang/ast/query-properties/top.js +5 -5
  201. package/dist/lang/ast/source-properties/field-list-edit.d.ts +4 -4
  202. package/dist/lang/ast/source-properties/field-list-edit.js +2 -2
  203. package/dist/lang/ast/source-properties/primary-key.d.ts +2 -2
  204. package/dist/lang/ast/source-properties/primary-key.js +2 -2
  205. package/dist/lang/ast/source-properties/renames.d.ts +2 -2
  206. package/dist/lang/ast/source-properties/renames.js +3 -3
  207. package/dist/lang/ast/source-properties/turtles.d.ts +2 -2
  208. package/dist/lang/ast/source-properties/turtles.js +1 -1
  209. package/dist/lang/ast/sources/named-source.d.ts +4 -4
  210. package/dist/lang/ast/sources/named-source.js +5 -5
  211. package/dist/lang/ast/sources/query-source.d.ts +3 -3
  212. package/dist/lang/ast/sources/query-source.js +3 -3
  213. package/dist/lang/ast/sources/sql-source.d.ts +2 -2
  214. package/dist/lang/ast/sources/sql-source.js +2 -2
  215. package/dist/lang/ast/sources/table-source.d.ts +2 -2
  216. package/dist/lang/ast/sources/table-source.js +7 -7
  217. package/dist/lang/ast/space-seed.d.ts +2 -2
  218. package/dist/lang/ast/space-seed.js +1 -1
  219. package/dist/lang/ast/sql-elements/sql-statement.d.ts +4 -4
  220. package/dist/lang/ast/sql-elements/sql-statement.js +9 -9
  221. package/dist/lang/ast/sql-elements/sql-string.d.ts +3 -3
  222. package/dist/lang/ast/sql-elements/sql-string.js +6 -6
  223. package/dist/lang/ast/struct-utils.d.ts +2 -2
  224. package/dist/lang/ast/struct-utils.js +3 -3
  225. package/dist/lang/ast/time-utils.d.ts +6 -6
  226. package/dist/lang/ast/time-utils.js +46 -46
  227. package/dist/lang/ast/types/document-compile-result.d.ts +2 -2
  228. package/dist/lang/ast/types/executor.d.ts +3 -3
  229. package/dist/lang/ast/types/explore-desc.d.ts +2 -2
  230. package/dist/lang/ast/types/explore-desc.js +1 -1
  231. package/dist/lang/ast/types/explore-field.d.ts +3 -3
  232. package/dist/lang/ast/types/expr-result.d.ts +2 -2
  233. package/dist/lang/ast/types/expr-value.d.ts +2 -2
  234. package/dist/lang/ast/types/expression-def.d.ts +4 -4
  235. package/dist/lang/ast/types/expression-def.js +86 -86
  236. package/dist/lang/ast/types/field-collection-member.d.ts +3 -3
  237. package/dist/lang/ast/types/field-decl.d.ts +5 -5
  238. package/dist/lang/ast/types/field-space.d.ts +5 -5
  239. package/dist/lang/ast/types/field-space.js +1 -1
  240. package/dist/lang/ast/types/granular-result.d.ts +3 -3
  241. package/dist/lang/ast/types/granular-result.js +1 -1
  242. package/dist/lang/ast/types/lookup-result.d.ts +1 -1
  243. package/dist/lang/ast/types/malloy-element.d.ts +6 -6
  244. package/dist/lang/ast/types/malloy-element.js +49 -49
  245. package/dist/lang/ast/types/model-entry.d.ts +1 -1
  246. package/dist/lang/ast/types/name-space.d.ts +1 -1
  247. package/dist/lang/ast/types/nested-query.d.ts +2 -2
  248. package/dist/lang/ast/types/op-desc.d.ts +2 -2
  249. package/dist/lang/ast/types/query-comp.d.ts +1 -1
  250. package/dist/lang/ast/types/query-element.d.ts +3 -3
  251. package/dist/lang/ast/types/query-item.d.ts +4 -4
  252. package/dist/lang/ast/types/query-property.d.ts +15 -15
  253. package/dist/lang/ast/types/source-property.d.ts +8 -8
  254. package/dist/lang/ast/types/space-entry.d.ts +2 -2
  255. package/dist/lang/ast/types/space-field.d.ts +4 -4
  256. package/dist/lang/ast/types/space-field.js +4 -4
  257. package/dist/lang/ast/types/space-param.d.ts +4 -4
  258. package/dist/lang/ast/types/space-param.js +4 -4
  259. package/dist/lang/ast/types/time-result.d.ts +2 -2
  260. package/dist/lang/ast/types/turtle-headed-pipe.d.ts +2 -2
  261. package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
  262. package/dist/lang/ast/types/type-desc.d.ts +3 -3
  263. package/dist/lang/field-utils.d.ts +1 -1
  264. package/dist/lang/field-utils.js +4 -4
  265. package/dist/lang/index.d.ts +10 -10
  266. package/dist/lang/malloy-to-ast.d.ts +8 -8
  267. package/dist/lang/malloy-to-ast.js +68 -68
  268. package/dist/lang/parse-error-handler.d.ts +3 -3
  269. package/dist/lang/parse-error-handler.js +4 -4
  270. package/dist/lang/parse-log.d.ts +2 -2
  271. package/dist/lang/parse-log.js +1 -1
  272. package/dist/lang/parse-malloy.d.ts +7 -7
  273. package/dist/lang/parse-malloy.js +81 -81
  274. package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +2 -2
  275. package/dist/lang/parse-tree-walkers/document-completion-walker.js +38 -38
  276. package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +1 -1
  277. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +14 -14
  278. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +3 -3
  279. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -85
  280. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +4 -4
  281. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
  282. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +3 -3
  283. package/dist/lang/parse-tree-walkers/explore-query-walker.js +3 -3
  284. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +4 -4
  285. package/dist/lang/parse-tree-walkers/find-external-references.js +2 -2
  286. package/dist/lang/reference-list.d.ts +1 -1
  287. package/dist/lang/test/document-help-context-walker.spec.js +9 -9
  288. package/dist/lang/test/document-symbol-walker.spec.js +32 -32
  289. package/dist/lang/test/field-symbols.spec.js +87 -87
  290. package/dist/lang/test/parse.spec.d.ts +1 -1
  291. package/dist/lang/test/parse.spec.js +768 -768
  292. package/dist/lang/test/test-translator.d.ts +6 -6
  293. package/dist/lang/test/test-translator.js +159 -159
  294. package/dist/lang/translate-response.d.ts +7 -7
  295. package/dist/lang/translate-response.js +1 -1
  296. package/dist/lang/zone.d.ts +5 -5
  297. package/dist/lang/zone.js +8 -8
  298. package/dist/malloy.d.ts +7 -7
  299. package/dist/malloy.js +192 -192
  300. package/dist/model/index.d.ts +2 -2
  301. package/dist/model/malloy_query.d.ts +12 -12
  302. package/dist/model/malloy_query.js +497 -502
  303. package/dist/model/malloy_types.d.ts +68 -68
  304. package/dist/model/malloy_types.js +102 -102
  305. package/dist/model/sql_block.d.ts +1 -1
  306. package/dist/model/sql_block.js +4 -4
  307. package/dist/model/utils.d.ts +1 -1
  308. package/dist/model/utils.js +10 -10
  309. package/dist/runtime_types.d.ts +2 -2
  310. package/package.json +4 -1
@@ -27,113 +27,113 @@ const utils_1 = require("./expressions/utils");
27
27
  function timeOffset(timeType, from, op, n, timeframe) {
28
28
  return [
29
29
  {
30
- "type": "dialect",
31
- "function": "delta",
32
- "base": { "valueType": timeType, "value": from },
30
+ type: 'dialect',
31
+ function: 'delta',
32
+ base: { valueType: timeType, value: from },
33
33
  op,
34
- "delta": n,
35
- "units": timeframe
36
- }
34
+ delta: n,
35
+ units: timeframe,
36
+ },
37
37
  ];
38
38
  }
39
39
  exports.timeOffset = timeOffset;
40
40
  function castTo(castType, from, safe = false) {
41
41
  const cast = {
42
- "type": "dialect",
43
- "function": "cast",
44
- "dstType": castType,
45
- "expr": from,
46
- safe
42
+ type: 'dialect',
43
+ function: 'cast',
44
+ dstType: castType,
45
+ expr: from,
46
+ safe,
47
47
  };
48
48
  return [cast];
49
49
  }
50
50
  exports.castTo = castTo;
51
51
  function castTimestampToDate(from, safe = false) {
52
52
  const cast = {
53
- "type": "dialect",
54
- "function": "cast",
55
- "dstType": "date",
56
- "srcType": "timestamp",
57
- "expr": from,
58
- safe
53
+ type: 'dialect',
54
+ function: 'cast',
55
+ dstType: 'date',
56
+ srcType: 'timestamp',
57
+ expr: from,
58
+ safe,
59
59
  };
60
60
  return [cast];
61
61
  }
62
62
  exports.castTimestampToDate = castTimestampToDate;
63
63
  function castDateToTimestamp(from, safe = false) {
64
64
  const cast = {
65
- "type": "dialect",
66
- "function": "cast",
67
- "dstType": "timestamp",
68
- "srcType": "date",
69
- "expr": from,
70
- safe
65
+ type: 'dialect',
66
+ function: 'cast',
67
+ dstType: 'timestamp',
68
+ srcType: 'date',
69
+ expr: from,
70
+ safe,
71
71
  };
72
72
  return [cast];
73
73
  }
74
74
  exports.castDateToTimestamp = castDateToTimestamp;
75
75
  function resolution(timeframe) {
76
76
  switch (timeframe) {
77
- case "hour":
78
- case "minute":
79
- case "second":
80
- case "microsecond":
81
- case "millisecond":
82
- return "timestamp";
77
+ case 'hour':
78
+ case 'minute':
79
+ case 'second':
80
+ case 'microsecond':
81
+ case 'millisecond':
82
+ return 'timestamp';
83
83
  }
84
- return "date";
84
+ return 'date';
85
85
  }
86
86
  exports.resolution = resolution;
87
87
  function timeResult(t, tt) {
88
88
  if (tt) {
89
- return { ...t, "timeframe": tt };
89
+ return { ...t, timeframe: tt };
90
90
  }
91
91
  return t;
92
92
  }
93
93
  exports.timeResult = timeResult;
94
94
  function timeLiteral(literalStr, timeType, tz) {
95
95
  const fragment = {
96
- "type": "dialect",
97
- "function": "timeLiteral",
98
- "literal": literalStr,
99
- "literalType": timeType,
100
- "timezone": tz
96
+ type: 'dialect',
97
+ function: 'timeLiteral',
98
+ literal: literalStr,
99
+ literalType: timeType,
100
+ timezone: tz,
101
101
  };
102
102
  return [fragment];
103
103
  }
104
104
  exports.timeLiteral = timeLiteral;
105
105
  function timestampOffset(from, op, n, timeframe, fromNotTimestamp = false) {
106
- const useDatetime = ["week", "month", "quarter", "year"].includes(timeframe);
107
- const add = op === "+" ? "_ADD" : "_SUB";
106
+ const useDatetime = ['week', 'month', 'quarter', 'year'].includes(timeframe);
107
+ const add = op === '+' ? '_ADD' : '_SUB';
108
108
  const units = timeframe.toUpperCase();
109
109
  if (useDatetime) {
110
110
  return [
111
111
  `TIMESTAMP(DATETIME${add}(DATETIME(`,
112
112
  ...from,
113
- `),INTERVAL `,
113
+ '),INTERVAL ',
114
114
  ...n,
115
- ` ${units}))`
115
+ ` ${units}))`,
116
116
  ];
117
117
  }
118
- const typeFrom = fromNotTimestamp ? ["TIMESTAMP(", ...from, ")"] : from;
118
+ const typeFrom = fromNotTimestamp ? ['TIMESTAMP(', ...from, ')'] : from;
119
119
  return (0, utils_1.compressExpr)([
120
120
  `TIMESTAMP${add}(`,
121
121
  ...typeFrom,
122
- `,INTERVAL `,
122
+ ',INTERVAL ',
123
123
  ...n,
124
- ` ${units})`
124
+ ` ${units})`,
125
125
  ]);
126
126
  }
127
127
  exports.timestampOffset = timestampOffset;
128
128
  function dateOffset(from, op, n, timeframe) {
129
- const add = op === "+" ? "_ADD" : "_SUB";
129
+ const add = op === '+' ? '_ADD' : '_SUB';
130
130
  const units = timeframe.toUpperCase();
131
131
  return (0, utils_1.compressExpr)([
132
132
  `DATE${add}(`,
133
133
  ...from,
134
- `,INTERVAL `,
134
+ ',INTERVAL ',
135
135
  ...n,
136
- ` ${units})`
136
+ ` ${units})`,
137
137
  ]);
138
138
  }
139
139
  exports.dateOffset = dateOffset;
@@ -1,5 +1,5 @@
1
- import { ModelDef, Query, SQLBlockStructDef } from "../../../model/malloy_types";
2
- import { ModelDataRequest } from "../../translate-response";
1
+ import { ModelDef, Query, SQLBlockStructDef } from '../../../model/malloy_types';
2
+ import { ModelDataRequest } from '../../translate-response';
3
3
  export interface DocumentCompileResult {
4
4
  modelDef: ModelDef;
5
5
  queryList: Query[];
@@ -1,6 +1,6 @@
1
- import { PipeSegment } from "../../../model/malloy_types";
2
- import { QueryProperty } from "./query-property";
3
- import { QueryInputSpace, QuerySpace } from "../field-space/query-spaces";
1
+ import { PipeSegment } from '../../../model/malloy_types';
2
+ import { QueryProperty } from './query-property';
3
+ import { QueryInputSpace, QuerySpace } from '../field-space/query-spaces';
4
4
  export interface Executor {
5
5
  inputFS: QueryInputSpace;
6
6
  resultFS: QuerySpace;
@@ -1,5 +1,5 @@
1
- import { SourceProperty } from "./source-property";
2
- import { ListOf } from "./malloy-element";
1
+ import { SourceProperty } from './source-property';
2
+ import { ListOf } from './malloy-element';
3
3
  export declare class ExploreDesc extends ListOf<SourceProperty> {
4
4
  constructor(props: SourceProperty[]);
5
5
  }
@@ -26,7 +26,7 @@ exports.ExploreDesc = void 0;
26
26
  const malloy_element_1 = require("./malloy-element");
27
27
  class ExploreDesc extends malloy_element_1.ListOf {
28
28
  constructor(props) {
29
- super("exploreDesc", props);
29
+ super('exploreDesc', props);
30
30
  }
31
31
  }
32
32
  exports.ExploreDesc = ExploreDesc;
@@ -1,5 +1,5 @@
1
- import { RenameField } from "../source-properties/renames";
2
- import { FieldDecl } from "./field-decl";
3
- import { MalloyElement } from "./malloy-element";
1
+ import { RenameField } from '../source-properties/renames';
2
+ import { FieldDecl } from './field-decl';
3
+ import { MalloyElement } from './malloy-element';
4
4
  export declare type ExploreField = FieldDecl | RenameField;
5
5
  export declare function isExploreField(f: MalloyElement): f is ExploreField;
@@ -1,5 +1,5 @@
1
- import { Fragment } from "../../../model/malloy_types";
2
- import { TypeDesc } from "./type-desc";
1
+ import { Fragment } from '../../../model/malloy_types';
2
+ import { TypeDesc } from './type-desc';
3
3
  export interface ExprResult extends TypeDesc {
4
4
  value: Fragment[];
5
5
  }
@@ -1,3 +1,3 @@
1
- import { GranularResult } from "./granular-result";
2
- import { ExprResult } from "./expr-result";
1
+ import { GranularResult } from './granular-result';
2
+ import { ExprResult } from './expr-result';
3
3
  export declare type ExprValue = ExprResult | GranularResult;
@@ -1,7 +1,7 @@
1
- import { TimestampUnit } from "../../../model/malloy_types";
2
- import { ExprValue } from "./expr-value";
3
- import { FieldSpace } from "./field-space";
4
- import { MalloyElement } from "./malloy-element";
1
+ import { TimestampUnit } from '../../../model/malloy_types';
2
+ import { ExprValue } from './expr-value';
3
+ import { FieldSpace } from './field-space';
4
+ import { MalloyElement } from './malloy-element';
5
5
  /**
6
6
  * Root node for any element in an expression. These essentially
7
7
  * create a sub-tree in the larger AST. Expression nodes know
@@ -90,49 +90,49 @@ class ExpressionDef extends malloy_element_1.MalloyElement {
90
90
  exports.ExpressionDef = ExpressionDef;
91
91
  class ExprDuration extends ExpressionDef {
92
92
  constructor(n, timeframe) {
93
- super({ "n": n });
93
+ super({ n: n });
94
94
  this.n = n;
95
95
  this.timeframe = timeframe;
96
- this.elementType = "duration";
96
+ this.elementType = 'duration';
97
97
  this.legalChildTypes = [fragtype_utils_1.FT.timestampT, fragtype_utils_1.FT.dateT];
98
98
  }
99
99
  apply(fs, op, left) {
100
100
  const lhs = left.getExpression(fs);
101
101
  this.typeCheck(this, lhs);
102
- if ((0, malloy_types_1.isTimeFieldType)(lhs.dataType) && (op === "+" || op === "-")) {
102
+ if ((0, malloy_types_1.isTimeFieldType)(lhs.dataType) && (op === '+' || op === '-')) {
103
103
  const num = this.n.getExpression(fs);
104
104
  if (!fragtype_utils_1.FT.typeEq(num, fragtype_utils_1.FT.numberT)) {
105
105
  this.log(`Duration units needs number not '${num.dataType}`);
106
- return (0, ast_utils_1.errorFor)("illegal unit expression");
106
+ return (0, ast_utils_1.errorFor)('illegal unit expression');
107
107
  }
108
108
  let resultGranularity;
109
109
  // Only allow the output of this to be granular if the
110
110
  // granularities match, this is still an area where
111
111
  // more thought is required.
112
- if ((0, granular_result_1.isGranularResult)(lhs) && lhs.timeframe == this.timeframe) {
112
+ if ((0, granular_result_1.isGranularResult)(lhs) && lhs.timeframe === this.timeframe) {
113
113
  resultGranularity = lhs.timeframe;
114
114
  }
115
- if (lhs.dataType === "timestamp") {
116
- const result = (0, time_utils_1.timeOffset)("timestamp", lhs.value, op, num.value, this.timeframe);
115
+ if (lhs.dataType === 'timestamp') {
116
+ const result = (0, time_utils_1.timeOffset)('timestamp', lhs.value, op, num.value, this.timeframe);
117
117
  return (0, time_utils_1.timeResult)({
118
- "dataType": "timestamp",
119
- "expressionType": (0, malloy_types_1.maxExpressionType)(lhs.expressionType, num.expressionType),
120
- "value": result
118
+ dataType: 'timestamp',
119
+ expressionType: (0, malloy_types_1.maxExpressionType)(lhs.expressionType, num.expressionType),
120
+ value: result,
121
121
  }, resultGranularity);
122
122
  }
123
123
  return (0, time_utils_1.timeResult)({
124
- "dataType": "date",
125
- "expressionType": (0, malloy_types_1.maxExpressionType)(lhs.expressionType, num.expressionType),
126
- "value": (0, time_utils_1.timeOffset)("date", lhs.value, op, num.value, this.timeframe)
124
+ dataType: 'date',
125
+ expressionType: (0, malloy_types_1.maxExpressionType)(lhs.expressionType, num.expressionType),
126
+ value: (0, time_utils_1.timeOffset)('date', lhs.value, op, num.value, this.timeframe),
127
127
  }, resultGranularity);
128
128
  }
129
129
  return super.apply(fs, op, left);
130
130
  }
131
131
  getExpression(_fs) {
132
132
  return {
133
- "dataType": "duration",
134
- "expressionType": "scalar",
135
- "value": ["__ERROR_DURATION_IS_NOT_A_VALUE__"]
133
+ dataType: 'duration',
134
+ expressionType: 'scalar',
135
+ value: ['__ERROR_DURATION_IS_NOT_A_VALUE__'],
136
136
  };
137
137
  }
138
138
  }
@@ -142,7 +142,7 @@ function timeCompare(lhs, op, rhs) {
142
142
  if (lhs.dataType !== rhs.dataType) {
143
143
  let lval = lhs.value;
144
144
  let rval = rhs.value;
145
- if (lhs.dataType === "timestamp") {
145
+ if (lhs.dataType === 'timestamp') {
146
146
  lval = (0, time_utils_1.castTimestampToDate)(lval);
147
147
  }
148
148
  else {
@@ -154,43 +154,43 @@ function timeCompare(lhs, op, rhs) {
154
154
  return undefined;
155
155
  }
156
156
  function regexEqual(left, right) {
157
- if (left.dataType === "string") {
158
- if (right.dataType === "regular expression") {
157
+ if (left.dataType === 'string') {
158
+ if (right.dataType === 'regular expression') {
159
159
  return [
160
160
  {
161
- "type": "dialect",
162
- "function": "regexpMatch",
163
- "expr": left.value,
164
- "regexp": right.value[0].replace(/^r'/, "'")
165
- }
161
+ type: 'dialect',
162
+ function: 'regexpMatch',
163
+ expr: left.value,
164
+ regexp: right.value[0].replace(/^r'/, "'"),
165
+ },
166
166
  ];
167
167
  }
168
168
  }
169
- else if (right.dataType === "string") {
170
- if (left.dataType === "regular expression") {
169
+ else if (right.dataType === 'string') {
170
+ if (left.dataType === 'regular expression') {
171
171
  return [
172
172
  {
173
- "type": "dialect",
174
- "function": "regexpMatch",
175
- "expr": right.value,
176
- "regexp": left.value[0].replace(/^r'/, "'")
177
- }
173
+ type: 'dialect',
174
+ function: 'regexpMatch',
175
+ expr: right.value,
176
+ regexp: left.value[0].replace(/^r'/, "'"),
177
+ },
178
178
  ];
179
179
  }
180
180
  }
181
181
  return undefined;
182
182
  }
183
183
  function nullCompare(left, op, right) {
184
- const not = op === "!=" || op === "!~";
185
- if (left.dataType === "null" || right.dataType === "null") {
186
- const maybeNot = not ? " NOT" : "";
187
- if (left.dataType !== "null") {
184
+ const not = op === '!=' || op === '!~';
185
+ if (left.dataType === 'null' || right.dataType === 'null') {
186
+ const maybeNot = not ? ' NOT' : '';
187
+ if (left.dataType !== 'null') {
188
188
  return [...left.value, ` IS${maybeNot} NULL`];
189
189
  }
190
- if (right.dataType !== "null") {
190
+ if (right.dataType !== 'null') {
191
191
  return [...right.value, `IS${maybeNot} NULL`];
192
192
  }
193
- return [not ? "false" : "true"];
193
+ return [not ? 'false' : 'true'];
194
194
  }
195
195
  return undefined;
196
196
  }
@@ -198,24 +198,24 @@ function equality(fs, left, op, right) {
198
198
  const lhs = left.getExpression(fs);
199
199
  const rhs = right.getExpression(fs);
200
200
  // Unsupported types can be compare with null
201
- const checkUnsupport = lhs.dataType === "unsupported" || rhs.dataType === "unsupported";
201
+ const checkUnsupport = lhs.dataType === 'unsupported' || rhs.dataType === 'unsupported';
202
202
  if (checkUnsupport) {
203
- const oneNull = lhs.dataType === "null" || rhs.dataType === "null";
203
+ const oneNull = lhs.dataType === 'null' || rhs.dataType === 'null';
204
204
  const rawMatch = lhs.rawType && lhs.rawType === rhs.rawType;
205
205
  if (!(oneNull || rawMatch)) {
206
206
  const noGo = unsupportError(left, lhs, right, rhs);
207
207
  if (noGo) {
208
- return { ...noGo, "dataType": "boolean" };
208
+ return { ...noGo, dataType: 'boolean' };
209
209
  }
210
210
  }
211
211
  }
212
212
  let value = timeCompare(lhs, op, rhs) || (0, utils_1.compose)(lhs.value, op, rhs.value);
213
- if (lhs.dataType != "unknown" && rhs.dataType != "unknown") {
213
+ if (lhs.dataType !== 'unknown' && rhs.dataType !== 'unknown') {
214
214
  switch (op) {
215
- case "~":
216
- case "!~": {
217
- if (lhs.dataType === "string" && rhs.dataType === "string") {
218
- value = (0, utils_1.compose)(lhs.value, "LIKE", rhs.value);
215
+ case '~':
216
+ case '!~': {
217
+ if (lhs.dataType === 'string' && rhs.dataType === 'string') {
218
+ value = (0, utils_1.compose)(lhs.value, 'LIKE', rhs.value);
219
219
  }
220
220
  else {
221
221
  const regexCmp = regexEqual(lhs, rhs);
@@ -227,23 +227,23 @@ function equality(fs, left, op, right) {
227
227
  value = (0, utils_1.nullsafeNot)(value, op);
228
228
  break;
229
229
  }
230
- case "=":
231
- case "!=": {
230
+ case '=':
231
+ case '!=': {
232
232
  const nullCmp = nullCompare(lhs, op, rhs);
233
233
  if (nullCmp) {
234
234
  value = nullCmp;
235
235
  }
236
236
  else {
237
- value = (0, utils_1.nullsafeNot)(regexEqual(lhs, rhs) || (0, utils_1.compose)(lhs.value, "=", rhs.value), op);
237
+ value = (0, utils_1.nullsafeNot)(regexEqual(lhs, rhs) || (0, utils_1.compose)(lhs.value, '=', rhs.value), op);
238
238
  }
239
239
  break;
240
240
  }
241
241
  }
242
242
  }
243
243
  return {
244
- "dataType": "boolean",
245
- "expressionType": (0, malloy_types_1.maxExpressionType)(lhs.expressionType, rhs.expressionType),
246
- value
244
+ dataType: 'boolean',
245
+ expressionType: (0, malloy_types_1.maxExpressionType)(lhs.expressionType, rhs.expressionType),
246
+ value,
247
247
  };
248
248
  }
249
249
  function compare(fs, left, op, right) {
@@ -252,13 +252,13 @@ function compare(fs, left, op, right) {
252
252
  const expressionType = (0, malloy_types_1.maxExpressionType)(lhs.expressionType, rhs.expressionType);
253
253
  const noCompare = unsupportError(left, lhs, right, rhs);
254
254
  if (noCompare) {
255
- return { ...noCompare, "dataType": "boolean" };
255
+ return { ...noCompare, dataType: 'boolean' };
256
256
  }
257
257
  const value = timeCompare(lhs, op, rhs) || (0, utils_1.compose)(lhs.value, op, rhs.value);
258
258
  return {
259
- "dataType": "boolean",
259
+ dataType: 'boolean',
260
260
  expressionType,
261
- "value": value
261
+ value: value,
262
262
  };
263
263
  }
264
264
  function oneOf(op, ...operators) {
@@ -280,15 +280,15 @@ function numeric(fs, left, op, right) {
280
280
  return noGo;
281
281
  }
282
282
  const expressionType = (0, malloy_types_1.maxExpressionType)(lhs.expressionType, rhs.expressionType);
283
- if (allAre("number", lhs, rhs)) {
283
+ if (allAre('number', lhs, rhs)) {
284
284
  return {
285
- "dataType": "number",
285
+ dataType: 'number',
286
286
  expressionType,
287
- "value": (0, utils_1.compose)(lhs.value, op, rhs.value)
287
+ value: (0, utils_1.compose)(lhs.value, op, rhs.value),
288
288
  };
289
289
  }
290
290
  left.log(`Non numeric('${lhs.dataType},${rhs.dataType}') value with '${op}'`);
291
- return (0, ast_utils_1.errorFor)("numbers required");
291
+ return (0, ast_utils_1.errorFor)('numbers required');
292
292
  }
293
293
  function delta(fs, left, op, right) {
294
294
  const lhs = left.getExpression(fs);
@@ -299,12 +299,12 @@ function delta(fs, left, op, right) {
299
299
  }
300
300
  if ((0, malloy_types_1.isTimeFieldType)(lhs.dataType)) {
301
301
  let duration = right;
302
- if (rhs.dataType !== "duration") {
302
+ if (rhs.dataType !== 'duration') {
303
303
  if ((0, granular_result_1.isGranularResult)(lhs)) {
304
304
  duration = new ExprDuration(right, lhs.timeframe);
305
305
  }
306
- else if (lhs.dataType === "date") {
307
- duration = new ExprDuration(right, "day");
306
+ else if (lhs.dataType === 'date') {
307
+ duration = new ExprDuration(right, 'day');
308
308
  }
309
309
  else {
310
310
  left.log(`Can not offset time by '${rhs.dataType}'`);
@@ -333,43 +333,43 @@ function applyBinary(fs, left, op, right) {
333
333
  if ((0, comparison_1.isComparison)(op)) {
334
334
  return compare(fs, left, op, right);
335
335
  }
336
- if (oneOf(op, "+", "-")) {
336
+ if (oneOf(op, '+', '-')) {
337
337
  return delta(fs, left, op, right);
338
338
  }
339
- if (oneOf(op, "*", "%")) {
339
+ if (oneOf(op, '*', '%')) {
340
340
  return numeric(fs, left, op, right);
341
341
  }
342
- if (oneOf(op, "/")) {
342
+ if (oneOf(op, '/')) {
343
343
  const num = left.getExpression(fs);
344
344
  const denom = right.getExpression(fs);
345
345
  const noGo = unsupportError(left, num, right, denom);
346
346
  if (noGo) {
347
- left.log("Cannot operate with unsupported type");
347
+ left.log('Cannot operate with unsupported type');
348
348
  return noGo;
349
349
  }
350
- if (num.dataType != "number") {
351
- left.log("Numerator for division must be a number");
350
+ if (num.dataType !== 'number') {
351
+ left.log('Numerator for division must be a number');
352
352
  }
353
- else if (denom.dataType != "number") {
354
- right.log("Denominator for division must be a number");
353
+ else if (denom.dataType !== 'number') {
354
+ right.log('Denominator for division must be a number');
355
355
  }
356
356
  else {
357
357
  const div = {
358
- "type": "dialect",
359
- "function": "div",
360
- "numerator": num.value,
361
- "denominator": denom.value
358
+ type: 'dialect',
359
+ function: 'div',
360
+ numerator: num.value,
361
+ denominator: denom.value,
362
362
  };
363
363
  return {
364
- "dataType": "number",
365
- "expressionType": (0, malloy_types_1.maxExpressionType)(num.expressionType, denom.expressionType),
366
- "value": [div]
364
+ dataType: 'number',
365
+ expressionType: (0, malloy_types_1.maxExpressionType)(num.expressionType, denom.expressionType),
366
+ value: [div],
367
367
  };
368
368
  }
369
- return (0, ast_utils_1.errorFor)("divide type mismatch");
369
+ return (0, ast_utils_1.errorFor)('divide type mismatch');
370
370
  }
371
371
  left.log(`Cannot use ${op} operator here`);
372
- return (0, ast_utils_1.errorFor)("applybinary bad operator");
372
+ return (0, ast_utils_1.errorFor)('applybinary bad operator');
373
373
  }
374
374
  exports.applyBinary = applyBinary;
375
375
  /**
@@ -377,16 +377,16 @@ exports.applyBinary = applyBinary;
377
377
  */
378
378
  function unsupportError(l, lhs, r, rhs) {
379
379
  const ret = {
380
- "dataType": lhs.dataType,
381
- "expressionType": (0, malloy_types_1.maxExpressionType)(lhs.expressionType, rhs.expressionType),
382
- "value": ["'unsupported operation'"]
380
+ dataType: lhs.dataType,
381
+ expressionType: (0, malloy_types_1.maxExpressionType)(lhs.expressionType, rhs.expressionType),
382
+ value: ["'unsupported operation'"],
383
383
  };
384
- if (lhs.dataType === "unsupported") {
385
- l.log("Unsupported type not allowed in expression");
386
- return { ...ret, "dataType": rhs.dataType };
384
+ if (lhs.dataType === 'unsupported') {
385
+ l.log('Unsupported type not allowed in expression');
386
+ return { ...ret, dataType: rhs.dataType };
387
387
  }
388
- if (rhs.dataType === "unsupported") {
389
- r.log("Unsupported type not allowed in expression");
388
+ if (rhs.dataType === 'unsupported') {
389
+ r.log('Unsupported type not allowed in expression');
390
390
  return ret;
391
391
  }
392
392
  return undefined;
@@ -1,5 +1,5 @@
1
- import { FieldDeclaration } from "../query-items/field-declaration";
2
- import { FieldReferenceElement } from "../query-items/field-references";
3
- import { MalloyElement } from "./malloy-element";
1
+ import { FieldDeclaration } from '../query-items/field-declaration';
2
+ import { FieldReferenceElement } from '../query-items/field-references';
3
+ import { MalloyElement } from './malloy-element';
4
4
  export declare type FieldCollectionMember = FieldReferenceElement | FieldDeclaration;
5
5
  export declare function isFieldCollectionMember(el: MalloyElement): el is FieldCollectionMember;
@@ -1,7 +1,7 @@
1
- import { TurtleDecl } from "../query-properties/nest";
2
- import { Turtles } from "../source-properties/turtles";
3
- import { FieldDeclaration } from "../query-items/field-declaration";
4
- import { Join } from "../query-properties/joins";
5
- import { MalloyElement } from "./malloy-element";
1
+ import { TurtleDecl } from '../query-properties/nest';
2
+ import { Turtles } from '../source-properties/turtles';
3
+ import { FieldDeclaration } from '../query-items/field-declaration';
4
+ import { Join } from '../query-properties/joins';
5
+ import { MalloyElement } from './malloy-element';
6
6
  export declare type FieldDecl = FieldDeclaration | Join | TurtleDecl | Turtles;
7
7
  export declare function isFieldDecl(f: MalloyElement): f is FieldDecl;
@@ -1,13 +1,13 @@
1
- import { Dialect } from "../../../dialect/dialect";
2
- import { StructDef } from "../../../model/malloy_types";
3
- import { LookupResult } from "./lookup-result";
4
- import { MalloyElement } from "./malloy-element";
1
+ import { Dialect } from '../../../dialect/dialect';
2
+ import { StructDef } from '../../../model/malloy_types';
3
+ import { LookupResult } from './lookup-result';
4
+ import { MalloyElement } from './malloy-element';
5
5
  /**
6
6
  * A FieldSpace is a hierarchy of namespaces, where the leaf nodes
7
7
  * are fields. A FieldSpace can lookup fields, and generate a StructDef
8
8
  */
9
9
  export interface FieldSpace {
10
- type: "fieldSpace";
10
+ type: 'fieldSpace';
11
11
  structDef(): StructDef;
12
12
  emptyStructDef(): StructDef;
13
13
  lookup(symbol: FieldName[]): LookupResult;
@@ -28,7 +28,7 @@ class FieldName extends malloy_element_1.MalloyElement {
28
28
  constructor(name) {
29
29
  super();
30
30
  this.name = name;
31
- this.elementType = "fieldName";
31
+ this.elementType = 'fieldName';
32
32
  }
33
33
  get refString() {
34
34
  return this.name;