@malloydata/malloy 0.0.22-dev230202171033 → 0.0.22-dev230206094309
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.
- package/package.json +2 -2
- package/dist/connection_utils.d.ts +0 -1
- package/dist/connection_utils.js +0 -66
- package/dist/dialect/dialect.d.ts +0 -66
- package/dist/dialect/dialect.js +0 -85
- package/dist/dialect/dialect_map.d.ts +0 -3
- package/dist/dialect/dialect_map.js +0 -45
- package/dist/dialect/duckdb.d.ts +0 -52
- package/dist/dialect/duckdb.js +0 -364
- package/dist/dialect/index.d.ts +0 -6
- package/dist/dialect/index.js +0 -37
- package/dist/dialect/postgres.d.ts +0 -52
- package/dist/dialect/postgres.js +0 -330
- package/dist/dialect/standardsql.d.ts +0 -49
- package/dist/dialect/standardsql.js +0 -381
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -59
- package/dist/lang/ast/ast-main.d.ts +0 -118
- package/dist/lang/ast/ast-main.js +0 -537
- package/dist/lang/ast/ast-utils.d.ts +0 -10
- package/dist/lang/ast/ast-utils.js +0 -42
- package/dist/lang/ast/elements/define-explore.d.ts +0 -17
- package/dist/lang/ast/elements/define-explore.js +0 -79
- package/dist/lang/ast/elements/define-query.d.ts +0 -14
- package/dist/lang/ast/elements/define-query.js +0 -56
- package/dist/lang/ast/elements/mallobj.d.ts +0 -12
- package/dist/lang/ast/elements/mallobj.js +0 -53
- package/dist/lang/ast/elements/pipeline-desc.d.ts +0 -28
- package/dist/lang/ast/elements/pipeline-desc.js +0 -102
- package/dist/lang/ast/elements/refined-explore.d.ts +0 -15
- package/dist/lang/ast/elements/refined-explore.js +0 -121
- package/dist/lang/ast/error-factory.d.ts +0 -9
- package/dist/lang/ast/error-factory.js +0 -61
- package/dist/lang/ast/executors/index-executor.d.ts +0 -18
- package/dist/lang/ast/executors/index-executor.js +0 -96
- package/dist/lang/ast/executors/project-executor.d.ts +0 -10
- package/dist/lang/ast/executors/project-executor.js +0 -68
- package/dist/lang/ast/executors/reduce-executor.d.ts +0 -20
- package/dist/lang/ast/executors/reduce-executor.js +0 -149
- package/dist/lang/ast/explore-properties/field-list-edit.d.ts +0 -8
- package/dist/lang/ast/explore-properties/field-list-edit.js +0 -36
- package/dist/lang/ast/explore-properties/primary-key.d.ts +0 -7
- package/dist/lang/ast/explore-properties/primary-key.js +0 -35
- package/dist/lang/ast/explore-properties/renames.d.ts +0 -11
- package/dist/lang/ast/explore-properties/renames.js +0 -43
- package/dist/lang/ast/explore-properties/turtles.d.ts +0 -5
- package/dist/lang/ast/explore-properties/turtles.js +0 -33
- package/dist/lang/ast/expressions/apply.d.ts +0 -8
- package/dist/lang/ast/expressions/apply.js +0 -37
- package/dist/lang/ast/expressions/binary-boolean.d.ts +0 -12
- package/dist/lang/ast/expressions/binary-boolean.js +0 -54
- package/dist/lang/ast/expressions/binary-numeric.d.ts +0 -11
- package/dist/lang/ast/expressions/binary-numeric.js +0 -42
- package/dist/lang/ast/expressions/boolean.d.ts +0 -8
- package/dist/lang/ast/expressions/boolean.js +0 -39
- package/dist/lang/ast/expressions/constant-sub-expression.d.ts +0 -16
- package/dist/lang/ast/expressions/constant-sub-expression.js +0 -98
- package/dist/lang/ast/expressions/expr-add-sub.d.ts +0 -4
- package/dist/lang/ast/expressions/expr-add-sub.js +0 -34
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +0 -15
- package/dist/lang/ast/expressions/expr-aggregate-function.js +0 -99
- package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +0 -11
- package/dist/lang/ast/expressions/expr-alternation-tree.js +0 -54
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +0 -10
- package/dist/lang/ast/expressions/expr-asymmetric.js +0 -27
- package/dist/lang/ast/expressions/expr-avg.d.ts +0 -6
- package/dist/lang/ast/expressions/expr-avg.js +0 -34
- package/dist/lang/ast/expressions/expr-case.d.ts +0 -11
- package/dist/lang/ast/expressions/expr-case.js +0 -84
- package/dist/lang/ast/expressions/expr-cast.d.ts +0 -13
- package/dist/lang/ast/expressions/expr-cast.js +0 -29
- package/dist/lang/ast/expressions/expr-compare.d.ts +0 -10
- package/dist/lang/ast/expressions/expr-compare.js +0 -48
- package/dist/lang/ast/expressions/expr-count-distinct.d.ts +0 -6
- package/dist/lang/ast/expressions/expr-count-distinct.js +0 -35
- package/dist/lang/ast/expressions/expr-count.d.ts +0 -11
- package/dist/lang/ast/expressions/expr-count.js +0 -57
- package/dist/lang/ast/expressions/expr-filter.d.ts +0 -12
- package/dist/lang/ast/expressions/expr-filter.js +0 -69
- package/dist/lang/ast/expressions/expr-func.d.ts +0 -10
- package/dist/lang/ast/expressions/expr-func.js +0 -63
- package/dist/lang/ast/expressions/expr-granular-time.d.ts +0 -24
- package/dist/lang/ast/expressions/expr-granular-time.js +0 -117
- package/dist/lang/ast/expressions/expr-id-reference.d.ts +0 -12
- package/dist/lang/ast/expressions/expr-id-reference.js +0 -76
- package/dist/lang/ast/expressions/expr-logical-op.d.ts +0 -9
- package/dist/lang/ast/expressions/expr-logical-op.js +0 -36
- package/dist/lang/ast/expressions/expr-max.d.ts +0 -9
- package/dist/lang/ast/expressions/expr-max.js +0 -16
- package/dist/lang/ast/expressions/expr-min.d.ts +0 -9
- package/dist/lang/ast/expressions/expr-min.js +0 -16
- package/dist/lang/ast/expressions/expr-minus.d.ts +0 -9
- package/dist/lang/ast/expressions/expr-minus.js +0 -48
- package/dist/lang/ast/expressions/expr-mul-div.d.ts +0 -4
- package/dist/lang/ast/expressions/expr-mul-div.js +0 -34
- package/dist/lang/ast/expressions/expr-not.d.ts +0 -10
- package/dist/lang/ast/expressions/expr-not.js +0 -49
- package/dist/lang/ast/expressions/expr-now.d.ts +0 -7
- package/dist/lang/ast/expressions/expr-now.js +0 -46
- package/dist/lang/ast/expressions/expr-null.d.ts +0 -6
- package/dist/lang/ast/expressions/expr-null.js +0 -41
- package/dist/lang/ast/expressions/expr-number.d.ts +0 -10
- package/dist/lang/ast/expressions/expr-number.js +0 -42
- package/dist/lang/ast/expressions/expr-parens.d.ts +0 -10
- package/dist/lang/ast/expressions/expr-parens.js +0 -42
- package/dist/lang/ast/expressions/expr-regex.d.ts +0 -8
- package/dist/lang/ast/expressions/expr-regex.js +0 -42
- package/dist/lang/ast/expressions/expr-string.d.ts +0 -9
- package/dist/lang/ast/expressions/expr-string.js +0 -50
- package/dist/lang/ast/expressions/expr-sum.d.ts +0 -6
- package/dist/lang/ast/expressions/expr-sum.js +0 -12
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +0 -13
- package/dist/lang/ast/expressions/expr-time-extract.js +0 -117
- package/dist/lang/ast/expressions/expr-time.d.ts +0 -11
- package/dist/lang/ast/expressions/expr-time.js +0 -62
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +0 -14
- package/dist/lang/ast/expressions/expr-ungroup.js +0 -83
- package/dist/lang/ast/expressions/for-range.d.ts +0 -19
- package/dist/lang/ast/expressions/for-range.js +0 -101
- package/dist/lang/ast/expressions/granular-literal.d.ts +0 -20
- package/dist/lang/ast/expressions/granular-literal.js +0 -148
- package/dist/lang/ast/expressions/partial-compare.d.ts +0 -14
- package/dist/lang/ast/expressions/partial-compare.js +0 -50
- package/dist/lang/ast/expressions/pick-when.d.ts +0 -19
- package/dist/lang/ast/expressions/pick-when.js +0 -156
- package/dist/lang/ast/expressions/range.d.ts +0 -12
- package/dist/lang/ast/expressions/range.js +0 -80
- package/dist/lang/ast/expressions/time-frame.d.ts +0 -7
- package/dist/lang/ast/expressions/time-frame.js +0 -40
- package/dist/lang/ast/expressions/top-by.d.ts +0 -10
- package/dist/lang/ast/expressions/top-by.js +0 -51
- package/dist/lang/ast/expressions/unary.d.ts +0 -5
- package/dist/lang/ast/expressions/unary.js +0 -34
- package/dist/lang/ast/expressions/utils.d.ts +0 -15
- package/dist/lang/ast/expressions/utils.js +0 -106
- package/dist/lang/ast/expressions/when-clause.d.ts +0 -10
- package/dist/lang/ast/expressions/when-clause.js +0 -17
- package/dist/lang/ast/fragtype-utils.d.ts +0 -39
- package/dist/lang/ast/fragtype-utils.js +0 -100
- package/dist/lang/ast/import-elements/import-statement.d.ts +0 -9
- package/dist/lang/ast/import-elements/import-statement.js +0 -78
- package/dist/lang/ast/index.d.ts +0 -96
- package/dist/lang/ast/index.js +0 -135
- package/dist/lang/ast/json-elements/json-element.d.ts +0 -6
- package/dist/lang/ast/json-elements/json-element.js +0 -41
- package/dist/lang/ast/json-elements/json-struct-def.d.ts +0 -10
- package/dist/lang/ast/json-elements/json-struct-def.js +0 -48
- package/dist/lang/ast/nesting/nest-reference.d.ts +0 -7
- package/dist/lang/ast/nesting/nest-reference.js +0 -35
- package/dist/lang/ast/parameters/constant-parameter.d.ts +0 -8
- package/dist/lang/ast/parameters/constant-parameter.js +0 -54
- package/dist/lang/ast/parameters/has-parameter.d.ts +0 -19
- package/dist/lang/ast/parameters/has-parameter.js +0 -64
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +0 -9
- package/dist/lang/ast/query-elements/anonymous-query.js +0 -41
- package/dist/lang/ast/query-elements/existing-query.d.ts +0 -11
- package/dist/lang/ast/query-elements/existing-query.js +0 -79
- package/dist/lang/ast/query-elements/full-query.d.ts +0 -10
- package/dist/lang/ast/query-elements/full-query.js +0 -85
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +0 -9
- package/dist/lang/ast/query-elements/query-head-struct.js +0 -48
- package/dist/lang/ast/query-items/field-declaration.d.ts +0 -31
- package/dist/lang/ast/query-items/field-declaration.js +0 -137
- package/dist/lang/ast/query-items/field-references.d.ts +0 -25
- package/dist/lang/ast/query-items/field-references.js +0 -80
- package/dist/lang/ast/query-properties/aggregate.d.ts +0 -5
- package/dist/lang/ast/query-properties/aggregate.js +0 -39
- package/dist/lang/ast/query-properties/declare-fields.d.ts +0 -5
- package/dist/lang/ast/query-properties/declare-fields.js +0 -33
- package/dist/lang/ast/query-properties/dimmensions.d.ts +0 -5
- package/dist/lang/ast/query-properties/dimmensions.js +0 -36
- package/dist/lang/ast/query-properties/filters.d.ts +0 -18
- package/dist/lang/ast/query-properties/filters.js +0 -89
- package/dist/lang/ast/query-properties/group-by.d.ts +0 -5
- package/dist/lang/ast/query-properties/group-by.js +0 -39
- package/dist/lang/ast/query-properties/indexing.d.ts +0 -10
- package/dist/lang/ast/query-properties/indexing.js +0 -39
- package/dist/lang/ast/query-properties/joins.d.ts +0 -36
- package/dist/lang/ast/query-properties/joins.js +0 -143
- package/dist/lang/ast/query-properties/limit.d.ts +0 -6
- package/dist/lang/ast/query-properties/limit.js +0 -35
- package/dist/lang/ast/query-properties/measures.d.ts +0 -5
- package/dist/lang/ast/query-properties/measures.js +0 -36
- package/dist/lang/ast/query-properties/nests.d.ts +0 -5
- package/dist/lang/ast/query-properties/nests.js +0 -33
- package/dist/lang/ast/query-properties/ordering.d.ts +0 -15
- package/dist/lang/ast/query-properties/ordering.js +0 -66
- package/dist/lang/ast/query-properties/project-statement.d.ts +0 -5
- package/dist/lang/ast/query-properties/project-statement.js +0 -33
- package/dist/lang/ast/query-properties/qop-desc.d.ts +0 -17
- package/dist/lang/ast/query-properties/qop-desc.js +0 -123
- package/dist/lang/ast/query-properties/sampling.d.ts +0 -8
- package/dist/lang/ast/query-properties/sampling.js +0 -38
- package/dist/lang/ast/query-properties/top.d.ts +0 -13
- package/dist/lang/ast/query-properties/top.js +0 -60
- package/dist/lang/ast/result-spaces/index-field-space.d.ts +0 -10
- package/dist/lang/ast/result-spaces/index-field-space.js +0 -57
- package/dist/lang/ast/result-spaces/project-field-space.d.ts +0 -6
- package/dist/lang/ast/result-spaces/project-field-space.js +0 -51
- package/dist/lang/ast/result-spaces/reduce-field-space.d.ts +0 -7
- package/dist/lang/ast/result-spaces/reduce-field-space.js +0 -37
- package/dist/lang/ast/sources/named-source.d.ts +0 -19
- package/dist/lang/ast/sources/named-source.js +0 -147
- package/dist/lang/ast/sources/query-source.d.ts +0 -9
- package/dist/lang/ast/sources/query-source.js +0 -41
- package/dist/lang/ast/sources/sql-source.d.ts +0 -7
- package/dist/lang/ast/sources/sql-source.js +0 -54
- package/dist/lang/ast/sources/table-source.d.ts +0 -8
- package/dist/lang/ast/sources/table-source.js +0 -60
- package/dist/lang/ast/space-fields/column-space-field.d.ts +0 -9
- package/dist/lang/ast/space-fields/column-space-field.js +0 -40
- package/dist/lang/ast/space-fields/join-space-field.d.ts +0 -8
- package/dist/lang/ast/space-fields/join-space-field.js +0 -35
- package/dist/lang/ast/space-fields/query-field-struct.d.ts +0 -10
- package/dist/lang/ast/space-fields/query-field-struct.js +0 -46
- package/dist/lang/ast/space-fields/query-space-field.d.ts +0 -11
- package/dist/lang/ast/space-fields/query-space-field.js +0 -37
- package/dist/lang/ast/space-fields/reference-field.d.ts +0 -11
- package/dist/lang/ast/space-fields/reference-field.js +0 -45
- package/dist/lang/ast/space-fields/rename-space-field.d.ts +0 -11
- package/dist/lang/ast/space-fields/rename-space-field.js +0 -50
- package/dist/lang/ast/space-fields/wild-space-field.d.ts +0 -10
- package/dist/lang/ast/space-fields/wild-space-field.js +0 -40
- package/dist/lang/ast/space-parameters/abstract-parameter.d.ts +0 -10
- package/dist/lang/ast/space-parameters/abstract-parameter.js +0 -41
- package/dist/lang/ast/space-parameters/defined-parameter.d.ts +0 -9
- package/dist/lang/ast/space-parameters/defined-parameter.js +0 -40
- package/dist/lang/ast/space-seed.d.ts +0 -17
- package/dist/lang/ast/space-seed.js +0 -59
- package/dist/lang/ast/sql-elements/sql-statement.d.ts +0 -19
- package/dist/lang/ast/sql-elements/sql-statement.js +0 -80
- package/dist/lang/ast/sql-elements/sql-string.d.ts +0 -12
- package/dist/lang/ast/sql-elements/sql-string.js +0 -60
- package/dist/lang/ast/static-space.d.ts +0 -33
- package/dist/lang/ast/static-space.js +0 -167
- package/dist/lang/ast/struct-utils.d.ts +0 -4
- package/dist/lang/ast/struct-utils.js +0 -48
- package/dist/lang/ast/time-utils.d.ts +0 -12
- package/dist/lang/ast/time-utils.js +0 -140
- package/dist/lang/ast/types/comparison.d.ts +0 -11
- package/dist/lang/ast/types/comparison.js +0 -41
- package/dist/lang/ast/types/compart-types.d.ts +0 -10
- package/dist/lang/ast/types/compart-types.js +0 -37
- package/dist/lang/ast/types/document-compile-result.d.ts +0 -8
- package/dist/lang/ast/types/document-compile-result.js +0 -25
- package/dist/lang/ast/types/equality.d.ts +0 -7
- package/dist/lang/ast/types/equality.js +0 -37
- package/dist/lang/ast/types/executor.d.ts +0 -9
- package/dist/lang/ast/types/executor.js +0 -25
- package/dist/lang/ast/types/explore-desc.d.ts +0 -5
- package/dist/lang/ast/types/explore-desc.js +0 -33
- package/dist/lang/ast/types/explore-field.d.ts +0 -5
- package/dist/lang/ast/types/explore-field.js +0 -32
- package/dist/lang/ast/types/explore-property.d.ts +0 -10
- package/dist/lang/ast/types/explore-property.js +0 -43
- package/dist/lang/ast/types/expr-result.d.ts +0 -5
- package/dist/lang/ast/types/expr-result.js +0 -25
- package/dist/lang/ast/types/expr-value.d.ts +0 -3
- package/dist/lang/ast/types/expr-value.js +0 -25
- package/dist/lang/ast/types/expression-def.d.ts +0 -69
- package/dist/lang/ast/types/expression-def.js +0 -346
- package/dist/lang/ast/types/expression-value-type.d.ts +0 -2
- package/dist/lang/ast/types/expression-value-type.js +0 -25
- package/dist/lang/ast/types/field-collection-member.d.ts +0 -5
- package/dist/lang/ast/types/field-collection-member.js +0 -34
- package/dist/lang/ast/types/field-decl.d.ts +0 -7
- package/dist/lang/ast/types/field-decl.js +0 -37
- package/dist/lang/ast/types/field-map.d.ts +0 -2
- package/dist/lang/ast/types/field-map.js +0 -25
- package/dist/lang/ast/types/field-space.d.ts +0 -26
- package/dist/lang/ast/types/field-space.js +0 -48
- package/dist/lang/ast/types/field-type.d.ts +0 -6
- package/dist/lang/ast/types/field-type.js +0 -25
- package/dist/lang/ast/types/field-value-type.d.ts +0 -3
- package/dist/lang/ast/types/field-value-type.js +0 -25
- package/dist/lang/ast/types/frag-type.d.ts +0 -6
- package/dist/lang/ast/types/frag-type.js +0 -25
- package/dist/lang/ast/types/granular-result.d.ts +0 -7
- package/dist/lang/ast/types/granular-result.js +0 -11
- package/dist/lang/ast/types/lookup-result.d.ts +0 -10
- package/dist/lang/ast/types/lookup-result.js +0 -25
- package/dist/lang/ast/types/malloy-element.d.ts +0 -105
- package/dist/lang/ast/types/malloy-element.js +0 -398
- package/dist/lang/ast/types/model-entry.d.ts +0 -6
- package/dist/lang/ast/types/model-entry.js +0 -25
- package/dist/lang/ast/types/name-space.d.ts +0 -5
- package/dist/lang/ast/types/name-space.js +0 -25
- package/dist/lang/ast/types/nested-query.d.ts +0 -3
- package/dist/lang/ast/types/nested-query.js +0 -25
- package/dist/lang/ast/types/op-desc.d.ts +0 -6
- package/dist/lang/ast/types/op-desc.js +0 -25
- package/dist/lang/ast/types/query-comp.d.ts +0 -5
- package/dist/lang/ast/types/query-comp.js +0 -25
- package/dist/lang/ast/types/query-element.d.ts +0 -5
- package/dist/lang/ast/types/query-element.js +0 -32
- package/dist/lang/ast/types/query-item.d.ts +0 -5
- package/dist/lang/ast/types/query-item.js +0 -25
- package/dist/lang/ast/types/query-property.d.ts +0 -17
- package/dist/lang/ast/types/query-property.js +0 -55
- package/dist/lang/ast/types/space-entry.d.ts +0 -5
- package/dist/lang/ast/types/space-entry.js +0 -29
- package/dist/lang/ast/types/space-field.d.ts +0 -10
- package/dist/lang/ast/types/space-field.js +0 -48
- package/dist/lang/ast/types/space-param.d.ts +0 -6
- package/dist/lang/ast/types/space-param.js +0 -34
- package/dist/lang/ast/types/stage-field-type.d.ts +0 -1
- package/dist/lang/ast/types/stage-field-type.js +0 -25
- package/dist/lang/ast/types/time-result.d.ts +0 -6
- package/dist/lang/ast/types/time-result.js +0 -25
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +0 -7
- package/dist/lang/ast/types/turtle-headed-pipe.js +0 -37
- package/dist/lang/field-utils.d.ts +0 -5
- package/dist/lang/field-utils.js +0 -43
- package/dist/lang/index.d.ts +0 -9
- package/dist/lang/index.js +0 -32
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +0 -165
- package/dist/lang/lib/Malloy/MalloyLexer.js +0 -1232
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +0 -1947
- package/dist/lang/lib/Malloy/MalloyParser.js +0 -11909
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +0 -2022
- package/dist/lang/lib/Malloy/MalloyParserListener.js +0 -4
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +0 -1274
- package/dist/lang/lib/Malloy/MalloyParserVisitor.js +0 -4
- package/dist/lang/parse-log.d.ts +0 -27
- package/dist/lang/parse-log.js +0 -51
- package/dist/lang/parse-malloy.d.ts +0 -236
- package/dist/lang/parse-malloy.js +0 -746
- package/dist/lang/parse-to-ast.d.ts +0 -155
- package/dist/lang/parse-to-ast.js +0 -990
- package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +0 -10
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +0 -148
- package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +0 -9
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +0 -107
- package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +0 -83
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +0 -385
- package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +0 -11
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +0 -182
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +0 -34
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +0 -74
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +0 -11
- package/dist/lang/parse-tree-walkers/find-external-references.js +0 -61
- package/dist/lang/reference-list.d.ts +0 -10
- package/dist/lang/reference-list.js +0 -90
- package/dist/lang/space-field.d.ts +0 -20
- package/dist/lang/space-field.js +0 -128
- package/dist/lang/test/document-help-context-walker.spec.d.ts +0 -1
- package/dist/lang/test/document-help-context-walker.spec.js +0 -55
- package/dist/lang/test/document-symbol-walker.spec.d.ts +0 -1
- package/dist/lang/test/document-symbol-walker.spec.js +0 -110
- package/dist/lang/test/field-symbols.spec.d.ts +0 -1
- package/dist/lang/test/field-symbols.spec.js +0 -184
- package/dist/lang/test/parse.spec.d.ts +0 -14
- package/dist/lang/test/parse.spec.js +0 -2135
- package/dist/lang/test/test-translator.d.ts +0 -40
- package/dist/lang/test/test-translator.js +0 -344
- package/dist/lang/zone.d.ts +0 -57
- package/dist/lang/zone.js +0 -107
- package/dist/malloy.d.ts +0 -1146
- package/dist/malloy.js +0 -2413
- package/dist/model/index.d.ts +0 -2
- package/dist/model/index.js +0 -45
- package/dist/model/malloy_query.d.ts +0 -351
- package/dist/model/malloy_query.js +0 -3174
- package/dist/model/malloy_types.d.ts +0 -551
- package/dist/model/malloy_types.js +0 -378
- package/dist/model/sql_block.d.ts +0 -7
- package/dist/model/sql_block.js +0 -56
- package/dist/model/utils.d.ts +0 -22
- package/dist/model/utils.js +0 -102
- package/dist/run_sql_options.d.ts +0 -3
- package/dist/run_sql_options.js +0 -25
- package/dist/runtime_types.d.ts +0 -105
- package/dist/runtime_types.js +0 -25
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.StandardSQLDialect = void 0;
|
|
26
|
-
const utils_1 = require("../model/utils");
|
|
27
|
-
const malloy_types_1 = require("../model/malloy_types");
|
|
28
|
-
const dialect_1 = require("./dialect");
|
|
29
|
-
const castMap = {
|
|
30
|
-
number: "float64",
|
|
31
|
-
};
|
|
32
|
-
// These are the units that "TIMESTAMP_ADD" accepts
|
|
33
|
-
const timestampAddUnits = [
|
|
34
|
-
"microsecond",
|
|
35
|
-
"millisecond",
|
|
36
|
-
"second",
|
|
37
|
-
"minute",
|
|
38
|
-
"hour",
|
|
39
|
-
"day",
|
|
40
|
-
];
|
|
41
|
-
const extractMap = {
|
|
42
|
-
day_of_week: "dayofweek",
|
|
43
|
-
day_of_year: "dayofyear",
|
|
44
|
-
};
|
|
45
|
-
class StandardSQLDialect extends dialect_1.Dialect {
|
|
46
|
-
constructor() {
|
|
47
|
-
super(...arguments);
|
|
48
|
-
this.name = "standardsql";
|
|
49
|
-
this.defaultNumberType = "FLOAT64";
|
|
50
|
-
this.udfPrefix = "__udf";
|
|
51
|
-
this.hasFinalStage = false;
|
|
52
|
-
this.stringTypeName = "STRING";
|
|
53
|
-
this.divisionIsInteger = false;
|
|
54
|
-
this.supportsSumDistinctFunction = false;
|
|
55
|
-
this.unnestWithNumbers = false;
|
|
56
|
-
this.defaultSampling = { enable: false };
|
|
57
|
-
this.supportUnnestArrayAgg = false;
|
|
58
|
-
this.supportsCTEinCoorelatedSubQueries = false;
|
|
59
|
-
this.dontUnionIndex = true; // bigquery can't use a sample table more than once in a query.
|
|
60
|
-
this.supportsQualify = true;
|
|
61
|
-
// I think we want an optional list of parameters types that we force a cast to.
|
|
62
|
-
this.functionInfo = {
|
|
63
|
-
timestamp_seconds: {
|
|
64
|
-
returnType: "timestamp",
|
|
65
|
-
},
|
|
66
|
-
concat: { returnType: "string" },
|
|
67
|
-
};
|
|
68
|
-
this.keywords = `
|
|
69
|
-
ALL
|
|
70
|
-
AND
|
|
71
|
-
ANY
|
|
72
|
-
ARRAY
|
|
73
|
-
AS
|
|
74
|
-
ASC
|
|
75
|
-
ASSERT_ROWS_MODIFIED
|
|
76
|
-
AT
|
|
77
|
-
BETWEEN
|
|
78
|
-
BY
|
|
79
|
-
CASE
|
|
80
|
-
CAST
|
|
81
|
-
COLLATE
|
|
82
|
-
CONTAINS
|
|
83
|
-
CREATE
|
|
84
|
-
CROSS
|
|
85
|
-
CUBE
|
|
86
|
-
CURRENT
|
|
87
|
-
DEFAULT
|
|
88
|
-
DEFINE
|
|
89
|
-
DESC
|
|
90
|
-
DISTINCT
|
|
91
|
-
ELSE
|
|
92
|
-
END
|
|
93
|
-
ENUM
|
|
94
|
-
ESCAPE
|
|
95
|
-
EXCEPT
|
|
96
|
-
EXCLUDE
|
|
97
|
-
EXISTS
|
|
98
|
-
EXTRACT
|
|
99
|
-
FALSE
|
|
100
|
-
FETCH
|
|
101
|
-
FOLLOWING
|
|
102
|
-
FOR
|
|
103
|
-
FROM
|
|
104
|
-
FULL
|
|
105
|
-
GROUP
|
|
106
|
-
GROUPING
|
|
107
|
-
GROUPS
|
|
108
|
-
HASH
|
|
109
|
-
HAVING
|
|
110
|
-
IF
|
|
111
|
-
IGNORE
|
|
112
|
-
IN
|
|
113
|
-
INNER
|
|
114
|
-
INTERSECT
|
|
115
|
-
INTERVAL
|
|
116
|
-
INTO
|
|
117
|
-
IS
|
|
118
|
-
JOIN
|
|
119
|
-
LATERAL
|
|
120
|
-
LEFT
|
|
121
|
-
LIKE
|
|
122
|
-
LIMIT
|
|
123
|
-
LOOKUP
|
|
124
|
-
MERGE
|
|
125
|
-
NATURAL
|
|
126
|
-
NEW
|
|
127
|
-
NO
|
|
128
|
-
NOT
|
|
129
|
-
NULL
|
|
130
|
-
NULLS
|
|
131
|
-
OF
|
|
132
|
-
ON
|
|
133
|
-
OR
|
|
134
|
-
ORDER
|
|
135
|
-
OUTER
|
|
136
|
-
OVER
|
|
137
|
-
PARTITION
|
|
138
|
-
PRECEDING
|
|
139
|
-
PROTO
|
|
140
|
-
RANGE
|
|
141
|
-
RECURSIVE
|
|
142
|
-
RESPECT
|
|
143
|
-
RIGHT
|
|
144
|
-
ROLLUP
|
|
145
|
-
ROWS
|
|
146
|
-
SELECT
|
|
147
|
-
SET
|
|
148
|
-
SOME
|
|
149
|
-
STRUCT
|
|
150
|
-
TABLESAMPLE
|
|
151
|
-
THEN
|
|
152
|
-
TO
|
|
153
|
-
TREAT
|
|
154
|
-
TRUE
|
|
155
|
-
UNBOUNDED
|
|
156
|
-
UNION
|
|
157
|
-
UNNEST
|
|
158
|
-
USING
|
|
159
|
-
WHEN
|
|
160
|
-
WHERE
|
|
161
|
-
WINDOW
|
|
162
|
-
WITH
|
|
163
|
-
WITHIN`.split(/\s/);
|
|
164
|
-
}
|
|
165
|
-
quoteTablePath(tablePath) {
|
|
166
|
-
return `\`${tablePath}\``;
|
|
167
|
-
}
|
|
168
|
-
sqlGroupSetTable(groupSetCount) {
|
|
169
|
-
return `CROSS JOIN (SELECT row_number() OVER() -1 group_set FROM UNNEST(GENERATE_ARRAY(0,${groupSetCount},1)))`;
|
|
170
|
-
}
|
|
171
|
-
sqlAnyValue(groupSet, fieldName) {
|
|
172
|
-
return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN ${fieldName} END)`;
|
|
173
|
-
}
|
|
174
|
-
// can array agg or any_value a struct...
|
|
175
|
-
sqlAggregateTurtle(groupSet, fieldList, orderBy, limit) {
|
|
176
|
-
let tail = "";
|
|
177
|
-
if (limit !== undefined) {
|
|
178
|
-
tail += ` LIMIT ${limit}`;
|
|
179
|
-
}
|
|
180
|
-
const fields = fieldList
|
|
181
|
-
.map((f) => `\n ${f.sqlExpression} as ${f.sqlOutputName}`)
|
|
182
|
-
.join(", ");
|
|
183
|
-
return `ARRAY_AGG(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}\n ) END IGNORE NULLS ${orderBy} ${tail})`;
|
|
184
|
-
}
|
|
185
|
-
sqlAnyValueTurtle(groupSet, fieldList) {
|
|
186
|
-
const fields = fieldList
|
|
187
|
-
.map((f) => `${f.sqlExpression} as ${f.sqlOutputName}`)
|
|
188
|
-
.join(", ");
|
|
189
|
-
return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}))`;
|
|
190
|
-
}
|
|
191
|
-
sqlAnyValueLastTurtle(name, groupSet, sqlName) {
|
|
192
|
-
return `ANY_VALUE(CASE WHEN group_set=${groupSet} THEN ${name}__${groupSet} END) as ${sqlName}`;
|
|
193
|
-
}
|
|
194
|
-
sqlCoaleseMeasuresInline(groupSet, fieldList) {
|
|
195
|
-
const fields = fieldList
|
|
196
|
-
.map((f) => `${f.sqlExpression} as ${f.sqlOutputName}`)
|
|
197
|
-
.join(", ");
|
|
198
|
-
const nullValues = fieldList
|
|
199
|
-
.map((f) => `NULL as ${f.sqlOutputName}`)
|
|
200
|
-
.join(", ");
|
|
201
|
-
return `COALESCE(ANY_VALUE(CASE WHEN group_set=${groupSet} THEN STRUCT(${fields}) END), STRUCT(${nullValues}))`;
|
|
202
|
-
}
|
|
203
|
-
//
|
|
204
|
-
// this code used to be:
|
|
205
|
-
//
|
|
206
|
-
// from += `JOIN UNNEST(GENERATE_ARRAY(0,${this.maxGroupSet},1)) as group_set\n`;
|
|
207
|
-
//
|
|
208
|
-
// BigQuery will allocate more resources if we use a CROSS JOIN so we do that instead.
|
|
209
|
-
//
|
|
210
|
-
sqlUnnestAlias(source, alias, fieldList, needDistinctKey, isArray) {
|
|
211
|
-
if (isArray) {
|
|
212
|
-
if (needDistinctKey) {
|
|
213
|
-
return `LEFT JOIN UNNEST(ARRAY(( SELECT AS STRUCT row_number() over() as __row_id, value FROM UNNEST(${source}) value))) as ${alias}`;
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
return `LEFT JOIN UNNEST(ARRAY((SELECT AS STRUCT value FROM unnest(${source}) value))) as ${alias}`;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
else if (needDistinctKey) {
|
|
220
|
-
return `LEFT JOIN UNNEST(ARRAY(( SELECT AS STRUCT row_number() over() as __row_id, * FROM UNNEST(${source})))) as ${alias}`;
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
return `LEFT JOIN UNNEST(${source}) as ${alias}`;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
sqlSumDistinctHashedKey(sqlDistinctKey) {
|
|
227
|
-
sqlDistinctKey = `CAST(${sqlDistinctKey} AS STRING)`;
|
|
228
|
-
const upperPart = `cast(cast(concat('0x', substr(to_hex(md5(${sqlDistinctKey})), 1, 15)) as int64) as numeric) * 4294967296`;
|
|
229
|
-
const lowerPart = `cast(cast(concat('0x', substr(to_hex(md5(${sqlDistinctKey})), 16, 8)) as int64) as numeric)`;
|
|
230
|
-
// See the comment below on `sql_sum_distinct` for why we multiply by this decimal
|
|
231
|
-
const precisionShiftMultiplier = "0.000000001";
|
|
232
|
-
return `(${upperPart} + ${lowerPart}) * ${precisionShiftMultiplier}`;
|
|
233
|
-
}
|
|
234
|
-
sqlGenerateUUID() {
|
|
235
|
-
return `GENERATE_UUID()`;
|
|
236
|
-
}
|
|
237
|
-
sqlFieldReference(alias, fieldName, _fieldType, _isNested, _isArray) {
|
|
238
|
-
return `${alias}.${fieldName}`;
|
|
239
|
-
}
|
|
240
|
-
sqlUnnestPipelineHead(isSingleton, sourceSQLExpression) {
|
|
241
|
-
let p = sourceSQLExpression;
|
|
242
|
-
if (isSingleton) {
|
|
243
|
-
p = `[${p}]`;
|
|
244
|
-
}
|
|
245
|
-
return `UNNEST(${p})`;
|
|
246
|
-
}
|
|
247
|
-
sqlCreateFunction(id, funcText) {
|
|
248
|
-
return `CREATE TEMPORARY FUNCTION ${id}(__param ANY TYPE) AS ((\n${(0, utils_1.indent)(funcText)}));\n`;
|
|
249
|
-
}
|
|
250
|
-
sqlCreateTableAsSelect(tableName, sql) {
|
|
251
|
-
return `
|
|
252
|
-
CREATE TABLE IF NOT EXISTS \`${tableName}\`
|
|
253
|
-
OPTIONS (
|
|
254
|
-
expiration_timestamp=TIMESTAMP_ADD(current_timestamp(), INTERVAL 1 hour)
|
|
255
|
-
)
|
|
256
|
-
AS (
|
|
257
|
-
${(0, utils_1.indent)(sql)}
|
|
258
|
-
);
|
|
259
|
-
`;
|
|
260
|
-
}
|
|
261
|
-
sqlCreateFunctionCombineLastStage(lastStageName) {
|
|
262
|
-
return `SELECT ARRAY((SELECT AS STRUCT * FROM ${lastStageName}))\n`;
|
|
263
|
-
}
|
|
264
|
-
sqlSelectAliasAsStruct(alias) {
|
|
265
|
-
return `(SELECT AS STRUCT ${alias}.*)`;
|
|
266
|
-
}
|
|
267
|
-
sqlMaybeQuoteIdentifier(identifier) {
|
|
268
|
-
return this.keywords.indexOf(identifier.toUpperCase()) > 0
|
|
269
|
-
? "`" + identifier + "`"
|
|
270
|
-
: identifier;
|
|
271
|
-
}
|
|
272
|
-
sqlNow() {
|
|
273
|
-
return (0, malloy_types_1.mkExpr) `CURRENT_TIMESTAMP()`;
|
|
274
|
-
}
|
|
275
|
-
sqlTrunc(sqlTime, units) {
|
|
276
|
-
if (sqlTime.valueType == "date") {
|
|
277
|
-
if ((0, malloy_types_1.isDateUnit)(units)) {
|
|
278
|
-
return (0, malloy_types_1.mkExpr) `DATE_TRUNC(${sqlTime.value},${units})`;
|
|
279
|
-
}
|
|
280
|
-
return (0, malloy_types_1.mkExpr) `TIMESTAMP(${sqlTime.value})`;
|
|
281
|
-
}
|
|
282
|
-
return (0, malloy_types_1.mkExpr) `TIMESTAMP_TRUNC(${sqlTime.value},${units})`;
|
|
283
|
-
}
|
|
284
|
-
sqlExtract(expr, units) {
|
|
285
|
-
const extractTo = extractMap[units] || units;
|
|
286
|
-
return (0, malloy_types_1.mkExpr) `EXTRACT(${extractTo} FROM ${expr.value})`;
|
|
287
|
-
}
|
|
288
|
-
sqlAlterTime(op, expr, n, timeframe) {
|
|
289
|
-
let theTime = expr.value;
|
|
290
|
-
let computeType = expr.valueType;
|
|
291
|
-
if (timeframe != "day" && timestampAddUnits.includes(timeframe)) {
|
|
292
|
-
// The units must be done in timestamp, no matter the input type
|
|
293
|
-
computeType = "timestamp";
|
|
294
|
-
if (expr.valueType != "timestamp") {
|
|
295
|
-
theTime = (0, malloy_types_1.mkExpr) `TIMESTAMP(${theTime})`;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
else if (expr.valueType == "timestamp") {
|
|
299
|
-
theTime = (0, malloy_types_1.mkExpr) `DATETIME(${theTime})`;
|
|
300
|
-
computeType = "datetime";
|
|
301
|
-
}
|
|
302
|
-
const funcName = computeType.toUpperCase() + (op == "+" ? "_ADD" : "_SUB");
|
|
303
|
-
const newTime = (0, malloy_types_1.mkExpr) `${funcName}(${theTime}, INTERVAL ${n} ${timeframe})`;
|
|
304
|
-
return computeType == "datetime" ? (0, malloy_types_1.mkExpr) `TIMESTAMP(${newTime})` : newTime;
|
|
305
|
-
}
|
|
306
|
-
ignoreInProject(fieldName) {
|
|
307
|
-
return fieldName === "_PARTITIONTIME";
|
|
308
|
-
}
|
|
309
|
-
sqlCast(cast) {
|
|
310
|
-
if (cast.srcType !== cast.dstType) {
|
|
311
|
-
const dstType = castMap[cast.dstType] || cast.dstType;
|
|
312
|
-
// This just makes the code look a little prettier ...
|
|
313
|
-
if (!cast.safe && cast.srcType && (0, malloy_types_1.isTimeFieldType)(cast.srcType)) {
|
|
314
|
-
if (dstType == "date") {
|
|
315
|
-
return (0, malloy_types_1.mkExpr) `DATE(${cast.expr})`;
|
|
316
|
-
}
|
|
317
|
-
return (0, malloy_types_1.mkExpr) `TIMESTAMP(${cast.expr})`;
|
|
318
|
-
}
|
|
319
|
-
const castFunc = cast.safe ? "SAFE_CAST" : "CAST";
|
|
320
|
-
return (0, malloy_types_1.mkExpr) `${castFunc}(${cast.expr} AS ${dstType})`;
|
|
321
|
-
}
|
|
322
|
-
return cast.expr;
|
|
323
|
-
}
|
|
324
|
-
sqlRegexpMatch(expr, regexp) {
|
|
325
|
-
return (0, malloy_types_1.mkExpr) `REGEXP_CONTAINS(${expr}, r${regexp})`;
|
|
326
|
-
}
|
|
327
|
-
sqlLiteralTime(timeString, type, timezone) {
|
|
328
|
-
if (type === "date") {
|
|
329
|
-
return `DATE('${timeString}')`;
|
|
330
|
-
}
|
|
331
|
-
else if (type === "timestamp") {
|
|
332
|
-
return `TIMESTAMP('${timeString}', '${timezone}')`;
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
throw new Error(`Unknown Liternal time format ${type}`);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
sqlMeasureTime(from, to, units) {
|
|
339
|
-
let lVal = from.value;
|
|
340
|
-
let rVal = to.value;
|
|
341
|
-
let diffUsing = "TIMESTAMP_DIFF";
|
|
342
|
-
if (units == "second" || units == "minute" || units == "hour") {
|
|
343
|
-
if (from.valueType != "timestamp") {
|
|
344
|
-
lVal = (0, malloy_types_1.mkExpr) `TIMESTAMP(${lVal})`;
|
|
345
|
-
}
|
|
346
|
-
if (to.valueType != "timestamp") {
|
|
347
|
-
rVal = (0, malloy_types_1.mkExpr) `TIMESTAMP(${rVal})`;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
diffUsing = "DATE_DIFF";
|
|
352
|
-
if (from.valueType != "date") {
|
|
353
|
-
lVal = (0, malloy_types_1.mkExpr) `DATE(${lVal})`;
|
|
354
|
-
}
|
|
355
|
-
if (to.valueType != "date") {
|
|
356
|
-
rVal = (0, malloy_types_1.mkExpr) `DATE(${rVal})`;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
return (0, malloy_types_1.mkExpr) `${diffUsing}(${rVal}, ${lVal}, ${units})`;
|
|
360
|
-
}
|
|
361
|
-
sqlSampleTable(tableSQL, sample) {
|
|
362
|
-
if (sample !== undefined) {
|
|
363
|
-
if ((0, malloy_types_1.isSamplingEnable)(sample) && sample.enable) {
|
|
364
|
-
sample = this.defaultSampling;
|
|
365
|
-
}
|
|
366
|
-
if ((0, malloy_types_1.isSamplingRows)(sample)) {
|
|
367
|
-
throw new Error(`StandardSQL doesn't support sampling by rows only percent`);
|
|
368
|
-
}
|
|
369
|
-
else if ((0, malloy_types_1.isSamplingPercent)(sample)) {
|
|
370
|
-
return `(SELECT * FROM ${tableSQL} TABLESAMPLE SYSTEM (${sample.percent} PERCENT))`;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
return tableSQL;
|
|
374
|
-
}
|
|
375
|
-
sqlLiteralString(literal) {
|
|
376
|
-
const noVirgule = literal.replace(/\\/g, "\\\\");
|
|
377
|
-
return "'" + noVirgule.replace(/'/g, "\\'") + "'";
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
exports.StandardSQLDialect = StandardSQLDialect;
|
|
381
|
-
//# sourceMappingURL=standardsql.js.map
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
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";
|
|
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";
|
|
9
|
-
export type { Loggable } from "./malloy";
|
|
10
|
-
export { toAsyncGenerator } from "./connection_utils";
|
package/dist/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.toAsyncGenerator = exports.DataWriter = exports.JSONWriter = exports.CSVWriter = exports.QueryMaterializer = exports.parseTableURI = exports.Result = exports.TimestampTimeframe = exports.DateTimeframe = exports.SourceRelationship = exports.JoinRelationship = exports.MalloyError = exports.FixedConnectionMap = exports.InMemoryURLReader = exports.EmptyURLReader = exports.SingleConnectionRuntime = exports.ConnectionRuntime = exports.AtomicFieldType = exports.Runtime = exports.Malloy = exports.MalloyTranslator = exports.HighlightType = exports.expressionIsCalculation = exports.flattenQuery = exports.isFilteredAliasedName = exports.Segment = void 0;
|
|
26
|
-
var model_1 = require("./model");
|
|
27
|
-
// Used in Composer Demo
|
|
28
|
-
Object.defineProperty(exports, "Segment", { enumerable: true, get: function () { return model_1.Segment; } });
|
|
29
|
-
Object.defineProperty(exports, "isFilteredAliasedName", { enumerable: true, get: function () { return model_1.isFilteredAliasedName; } });
|
|
30
|
-
Object.defineProperty(exports, "flattenQuery", { enumerable: true, get: function () { return model_1.flattenQuery; } });
|
|
31
|
-
Object.defineProperty(exports, "expressionIsCalculation", { enumerable: true, get: function () { return model_1.expressionIsCalculation; } });
|
|
32
|
-
var lang_1 = require("./lang");
|
|
33
|
-
// Neede for VSCode extension
|
|
34
|
-
Object.defineProperty(exports, "HighlightType", { enumerable: true, get: function () { return lang_1.HighlightType; } });
|
|
35
|
-
// Needed for tests only
|
|
36
|
-
Object.defineProperty(exports, "MalloyTranslator", { enumerable: true, get: function () { return lang_1.MalloyTranslator; } });
|
|
37
|
-
var malloy_1 = require("./malloy");
|
|
38
|
-
Object.defineProperty(exports, "Malloy", { enumerable: true, get: function () { return malloy_1.Malloy; } });
|
|
39
|
-
Object.defineProperty(exports, "Runtime", { enumerable: true, get: function () { return malloy_1.Runtime; } });
|
|
40
|
-
Object.defineProperty(exports, "AtomicFieldType", { enumerable: true, get: function () { return malloy_1.AtomicFieldType; } });
|
|
41
|
-
Object.defineProperty(exports, "ConnectionRuntime", { enumerable: true, get: function () { return malloy_1.ConnectionRuntime; } });
|
|
42
|
-
Object.defineProperty(exports, "SingleConnectionRuntime", { enumerable: true, get: function () { return malloy_1.SingleConnectionRuntime; } });
|
|
43
|
-
Object.defineProperty(exports, "EmptyURLReader", { enumerable: true, get: function () { return malloy_1.EmptyURLReader; } });
|
|
44
|
-
Object.defineProperty(exports, "InMemoryURLReader", { enumerable: true, get: function () { return malloy_1.InMemoryURLReader; } });
|
|
45
|
-
Object.defineProperty(exports, "FixedConnectionMap", { enumerable: true, get: function () { return malloy_1.FixedConnectionMap; } });
|
|
46
|
-
Object.defineProperty(exports, "MalloyError", { enumerable: true, get: function () { return malloy_1.MalloyError; } });
|
|
47
|
-
Object.defineProperty(exports, "JoinRelationship", { enumerable: true, get: function () { return malloy_1.JoinRelationship; } });
|
|
48
|
-
Object.defineProperty(exports, "SourceRelationship", { enumerable: true, get: function () { return malloy_1.SourceRelationship; } });
|
|
49
|
-
Object.defineProperty(exports, "DateTimeframe", { enumerable: true, get: function () { return malloy_1.DateTimeframe; } });
|
|
50
|
-
Object.defineProperty(exports, "TimestampTimeframe", { enumerable: true, get: function () { return malloy_1.TimestampTimeframe; } });
|
|
51
|
-
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return malloy_1.Result; } });
|
|
52
|
-
Object.defineProperty(exports, "parseTableURI", { enumerable: true, get: function () { return malloy_1.parseTableURI; } });
|
|
53
|
-
Object.defineProperty(exports, "QueryMaterializer", { enumerable: true, get: function () { return malloy_1.QueryMaterializer; } });
|
|
54
|
-
Object.defineProperty(exports, "CSVWriter", { enumerable: true, get: function () { return malloy_1.CSVWriter; } });
|
|
55
|
-
Object.defineProperty(exports, "JSONWriter", { enumerable: true, get: function () { return malloy_1.JSONWriter; } });
|
|
56
|
-
Object.defineProperty(exports, "DataWriter", { enumerable: true, get: function () { return malloy_1.DataWriter; } });
|
|
57
|
-
var connection_utils_1 = require("./connection_utils");
|
|
58
|
-
Object.defineProperty(exports, "toAsyncGenerator", { enumerable: true, get: function () { return connection_utils_1.toAsyncGenerator; } });
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import * as model from "../../model/malloy_types";
|
|
2
|
-
import { SpaceEntry } from "./types/space-entry";
|
|
3
|
-
import { ExploreField } from "./types/explore-field";
|
|
4
|
-
import { NestedQuery } from "./types/nested-query";
|
|
5
|
-
import { QueryItem } from "./types/query-item";
|
|
6
|
-
import { FieldListEdit } from "./explore-properties/field-list-edit";
|
|
7
|
-
import { FieldCollectionMember } from "./types/field-collection-member";
|
|
8
|
-
import { FieldDeclaration } from "./query-items/field-declaration";
|
|
9
|
-
import { FieldReference, WildcardFieldReference } from "./query-items/field-references";
|
|
10
|
-
import { FieldName, FieldSpace, SourceSpec } from "./types/field-space";
|
|
11
|
-
import { HasParameter } from "./parameters/has-parameter";
|
|
12
|
-
import { MalloyElement } from "./types/malloy-element";
|
|
13
|
-
import { Join } from "./query-properties/joins";
|
|
14
|
-
import { SpaceField } from "./types/space-field";
|
|
15
|
-
import { QueryField } from "./space-fields/query-space-field";
|
|
16
|
-
import { SpaceSeed } from "./space-seed";
|
|
17
|
-
import { StaticSpace } from "./static-space";
|
|
18
|
-
import { TurtleHeadedPipe } from "./types/turtle-headed-pipe";
|
|
19
|
-
import { FieldType } from "./types/field-type";
|
|
20
|
-
export declare class TurtleDecl extends TurtleHeadedPipe {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
constructor(name: string);
|
|
23
|
-
getPipeline(fs: FieldSpace): model.Pipeline;
|
|
24
|
-
getFieldDef(fs: FieldSpace, nestParent: QuerySpace | undefined): model.TurtleDef;
|
|
25
|
-
}
|
|
26
|
-
export declare class NestRefinement extends TurtleDecl {
|
|
27
|
-
elementType: string;
|
|
28
|
-
constructor(turtleName: FieldName);
|
|
29
|
-
}
|
|
30
|
-
export declare class NestDefinition extends TurtleDecl {
|
|
31
|
-
elementType: string;
|
|
32
|
-
constructor(name: string);
|
|
33
|
-
}
|
|
34
|
-
export declare function isNestedQuery(me: MalloyElement): me is NestedQuery;
|
|
35
|
-
/**
|
|
36
|
-
* A FieldSpace which may undergo modification
|
|
37
|
-
*/
|
|
38
|
-
export declare class DynamicSpace extends StaticSpace {
|
|
39
|
-
protected final: model.StructDef | undefined;
|
|
40
|
-
protected source: SpaceSeed;
|
|
41
|
-
outputFS?: QuerySpace;
|
|
42
|
-
completions: (() => void)[];
|
|
43
|
-
private complete;
|
|
44
|
-
constructor(extending: SourceSpec);
|
|
45
|
-
/**
|
|
46
|
-
* Factory for DynamicSpace when there are accept/except edits
|
|
47
|
-
* @param from A structdef which seeds this space
|
|
48
|
-
* @param choose A accept/except edit of the "from" fields
|
|
49
|
-
*/
|
|
50
|
-
static filteredFrom(from: model.StructDef, choose?: FieldListEdit): DynamicSpace;
|
|
51
|
-
whenComplete(finalizeStep: () => void): void;
|
|
52
|
-
isComplete(): void;
|
|
53
|
-
protected setEntry(name: string, value: SpaceEntry): void;
|
|
54
|
-
addParameters(params: HasParameter[]): DynamicSpace;
|
|
55
|
-
newEntry(name: string, astEl: MalloyElement, entry: SpaceEntry): void;
|
|
56
|
-
addField(...defs: ExploreField[]): void;
|
|
57
|
-
addFieldDef(fd: model.FieldDef): void;
|
|
58
|
-
structDef(): model.StructDef;
|
|
59
|
-
}
|
|
60
|
-
export declare abstract class ResultSpace extends DynamicSpace {
|
|
61
|
-
readonly queryInputSpace: FieldSpace;
|
|
62
|
-
readonly exprSpace: QuerySpace;
|
|
63
|
-
astEl?: MalloyElement | undefined;
|
|
64
|
-
abstract readonly segmentType: "reduce" | "project" | "index";
|
|
65
|
-
constructor(queryInputSpace: FieldSpace);
|
|
66
|
-
log(s: string): void;
|
|
67
|
-
addMembers(members: FieldCollectionMember[]): void;
|
|
68
|
-
addReference(ref: FieldReference): void;
|
|
69
|
-
addWild(wild: WildcardFieldReference): void;
|
|
70
|
-
/**
|
|
71
|
-
* Check for the definition of an ungrouping reference in the result space,
|
|
72
|
-
* or in the case of an exclude reference, if this query is nested
|
|
73
|
-
* in another query, in the result space of a query that this query
|
|
74
|
-
* is nested inside of.
|
|
75
|
-
*/
|
|
76
|
-
checkUngroup(fn: FieldName, isExclude: boolean): void;
|
|
77
|
-
addQueryItems(...qiList: QueryItem[]): void;
|
|
78
|
-
canContain(_qd: model.QueryFieldDef): boolean;
|
|
79
|
-
protected queryFieldDefs(): model.QueryFieldDef[];
|
|
80
|
-
getQuerySegment(rf: model.QuerySegment | undefined): model.QuerySegment;
|
|
81
|
-
getPipeSegment(refineFrom: model.QuerySegment | undefined): model.PipeSegment;
|
|
82
|
-
}
|
|
83
|
-
export declare class ExpressionFieldFromAst extends SpaceField {
|
|
84
|
-
readonly space: DynamicSpace;
|
|
85
|
-
readonly exprDef: FieldDeclaration;
|
|
86
|
-
fieldName: string;
|
|
87
|
-
defType?: FieldType;
|
|
88
|
-
constructor(space: DynamicSpace, exprDef: FieldDeclaration);
|
|
89
|
-
get name(): string;
|
|
90
|
-
fieldDef(): model.FieldDef;
|
|
91
|
-
getQueryFieldDef(fs: FieldSpace): model.QueryFieldDef;
|
|
92
|
-
type(): FieldType;
|
|
93
|
-
}
|
|
94
|
-
export declare class QueryFieldAST extends QueryField {
|
|
95
|
-
readonly turtle: TurtleDecl;
|
|
96
|
-
protected name: string;
|
|
97
|
-
renameAs?: string;
|
|
98
|
-
nestParent?: QuerySpace;
|
|
99
|
-
constructor(fs: FieldSpace, turtle: TurtleDecl, name: string);
|
|
100
|
-
getQueryFieldDef(fs: FieldSpace): model.QueryFieldDef;
|
|
101
|
-
fieldDef(): model.TurtleDef;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Unlike a source, which is a refinement of a namespace, a query
|
|
105
|
-
* is creating a new unrelated namespace. The query starts with a
|
|
106
|
-
* source, which it might modify. This set of fields used to resolve
|
|
107
|
-
* expressions in the query is called the "input space". There is a
|
|
108
|
-
* specialized QuerySpace for each type of query operation.
|
|
109
|
-
*
|
|
110
|
-
* The query output is managed by an instance of ResultSpace.
|
|
111
|
-
*/
|
|
112
|
-
export declare class QuerySpace extends DynamicSpace {
|
|
113
|
-
readonly result: ResultSpace;
|
|
114
|
-
nestParent?: QuerySpace;
|
|
115
|
-
extendList: string[];
|
|
116
|
-
constructor(input: SourceSpec, result: ResultSpace);
|
|
117
|
-
extendSource(extendField: Join | FieldDeclaration): void;
|
|
118
|
-
}
|