@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.
- package/dist/connection_utils.js +10 -10
- package/dist/dialect/dialect.d.ts +2 -2
- package/dist/dialect/dialect.js +13 -13
- package/dist/dialect/dialect_map.d.ts +1 -1
- package/dist/dialect/duckdb.d.ts +3 -3
- package/dist/dialect/duckdb.js +44 -44
- package/dist/dialect/index.d.ts +6 -6
- package/dist/dialect/postgres.d.ts +3 -3
- package/dist/dialect/postgres.js +46 -46
- package/dist/dialect/standardsql.d.ts +4 -4
- package/dist/dialect/standardsql.js +51 -51
- package/dist/index.d.ts +10 -10
- package/dist/lang/ast/ast-utils.d.ts +1 -1
- package/dist/lang/ast/ast-utils.js +3 -3
- package/dist/lang/ast/elements/define-query.d.ts +3 -3
- package/dist/lang/ast/elements/define-query.js +6 -6
- package/dist/lang/ast/elements/define-source.d.ts +4 -4
- package/dist/lang/ast/elements/define-source.js +8 -8
- package/dist/lang/ast/elements/import-statement.d.ts +2 -2
- package/dist/lang/ast/elements/import-statement.js +7 -7
- package/dist/lang/ast/elements/pipeline-desc.d.ts +5 -5
- package/dist/lang/ast/elements/pipeline-desc.js +11 -11
- package/dist/lang/ast/elements/refined-source.d.ts +4 -4
- package/dist/lang/ast/elements/refined-source.js +6 -6
- package/dist/lang/ast/elements/source.d.ts +3 -3
- package/dist/lang/ast/elements/source.js +1 -1
- package/dist/lang/ast/error-factory.d.ts +1 -1
- package/dist/lang/ast/error-factory.js +15 -15
- package/dist/lang/ast/executors/index-executor.d.ts +7 -7
- package/dist/lang/ast/executors/index-executor.js +4 -4
- package/dist/lang/ast/executors/project-executor.d.ts +5 -5
- package/dist/lang/ast/executors/project-executor.js +2 -2
- package/dist/lang/ast/executors/reduce-executor.d.ts +8 -8
- package/dist/lang/ast/executors/reduce-executor.js +5 -5
- package/dist/lang/ast/expressions/apply.d.ts +2 -2
- package/dist/lang/ast/expressions/apply.js +1 -1
- package/dist/lang/ast/expressions/binary-boolean.d.ts +3 -3
- package/dist/lang/ast/expressions/binary-boolean.js +6 -6
- package/dist/lang/ast/expressions/binary-numeric.d.ts +3 -3
- package/dist/lang/ast/expressions/binary-numeric.js +2 -2
- package/dist/lang/ast/expressions/boolean.d.ts +4 -4
- package/dist/lang/ast/expressions/boolean.js +2 -2
- package/dist/lang/ast/expressions/constant-sub-expression.d.ts +4 -4
- package/dist/lang/ast/expressions/constant-sub-expression.js +12 -12
- package/dist/lang/ast/expressions/expr-add-sub.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-add-sub.js +1 -1
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-aggregate-function.js +15 -15
- package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +6 -6
- package/dist/lang/ast/expressions/expr-alternation-tree.js +6 -6
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-asymmetric.js +3 -3
- package/dist/lang/ast/expressions/expr-avg.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-avg.js +2 -2
- package/dist/lang/ast/expressions/expr-cast.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-cast.js +6 -6
- package/dist/lang/ast/expressions/expr-compare.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-compare.js +9 -9
- package/dist/lang/ast/expressions/expr-count-distinct.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-count-distinct.js +1 -1
- package/dist/lang/ast/expressions/expr-count.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-count.js +10 -10
- package/dist/lang/ast/expressions/expr-filter.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-filter.js +13 -13
- package/dist/lang/ast/expressions/expr-func.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-func.js +8 -8
- package/dist/lang/ast/expressions/expr-granular-time.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-granular-time.js +17 -17
- package/dist/lang/ast/expressions/expr-id-reference.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
- package/dist/lang/ast/expressions/expr-logical-op.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
- package/dist/lang/ast/expressions/expr-max.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-max.js +1 -1
- package/dist/lang/ast/expressions/expr-min.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-min.js +1 -1
- package/dist/lang/ast/expressions/expr-minus.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-minus.js +5 -5
- package/dist/lang/ast/expressions/expr-mul-div.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-mul-div.js +1 -1
- package/dist/lang/ast/expressions/expr-not.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-not.js +3 -3
- package/dist/lang/ast/expressions/expr-now.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-now.js +8 -8
- package/dist/lang/ast/expressions/expr-null.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-null.js +4 -4
- package/dist/lang/ast/expressions/expr-number.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-number.js +2 -2
- package/dist/lang/ast/expressions/expr-parens.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-parens.js +3 -3
- package/dist/lang/ast/expressions/expr-regex.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-regex.js +4 -4
- package/dist/lang/ast/expressions/expr-string.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-string.js +8 -8
- package/dist/lang/ast/expressions/expr-sum.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-sum.js +2 -2
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-time-extract.js +30 -30
- package/dist/lang/ast/expressions/expr-time.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-time.js +10 -10
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +6 -6
- package/dist/lang/ast/expressions/expr-ungroup.js +13 -13
- package/dist/lang/ast/expressions/for-range.d.ts +4 -4
- package/dist/lang/ast/expressions/for-range.js +17 -17
- package/dist/lang/ast/expressions/granular-literal.d.ts +4 -4
- package/dist/lang/ast/expressions/granular-literal.js +34 -34
- package/dist/lang/ast/expressions/partial-compare.d.ts +4 -4
- package/dist/lang/ast/expressions/partial-compare.js +4 -4
- package/dist/lang/ast/expressions/pick-when.d.ts +4 -4
- package/dist/lang/ast/expressions/pick-when.js +32 -32
- package/dist/lang/ast/expressions/range.d.ts +3 -3
- package/dist/lang/ast/expressions/range.js +20 -20
- package/dist/lang/ast/expressions/time-frame.d.ts +2 -2
- package/dist/lang/ast/expressions/time-frame.js +3 -3
- package/dist/lang/ast/expressions/top-by.d.ts +4 -4
- package/dist/lang/ast/expressions/top-by.js +5 -5
- package/dist/lang/ast/expressions/unary.d.ts +1 -1
- package/dist/lang/ast/expressions/unary.js +1 -1
- package/dist/lang/ast/expressions/utils.d.ts +2 -2
- package/dist/lang/ast/expressions/utils.js +6 -6
- package/dist/lang/ast/field-space/column-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/dynamic-space.d.ts +7 -7
- package/dist/lang/ast/field-space/dynamic-space.js +2 -2
- package/dist/lang/ast/field-space/field-definition-value.d.ts +5 -5
- package/dist/lang/ast/field-space/index-field-space.d.ts +3 -3
- package/dist/lang/ast/field-space/index-field-space.js +4 -4
- package/dist/lang/ast/field-space/join-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/project-field-space.d.ts +2 -2
- package/dist/lang/ast/field-space/project-field-space.js +5 -5
- package/dist/lang/ast/field-space/query-field-struct.d.ts +3 -3
- package/dist/lang/ast/field-space/query-field-struct.js +1 -1
- package/dist/lang/ast/field-space/query-space-field.d.ts +4 -4
- package/dist/lang/ast/field-space/query-space-field.js +1 -1
- package/dist/lang/ast/field-space/query-spaces.d.ts +11 -11
- package/dist/lang/ast/field-space/query-spaces.js +8 -8
- package/dist/lang/ast/field-space/reference-field.d.ts +5 -5
- package/dist/lang/ast/field-space/reference-field.js +1 -1
- package/dist/lang/ast/field-space/refined-space.d.ts +4 -4
- package/dist/lang/ast/field-space/refined-space.js +2 -2
- package/dist/lang/ast/field-space/rename-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/rename-space-field.js +2 -2
- package/dist/lang/ast/field-space/static-space.d.ts +7 -7
- package/dist/lang/ast/field-space/static-space.js +12 -12
- package/dist/lang/ast/field-space/struct-space-field-base.d.ts +4 -4
- package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
- package/dist/lang/ast/field-space/wild-space-field.d.ts +4 -4
- package/dist/lang/ast/field-space/wild-space-field.js +1 -1
- package/dist/lang/ast/fragtype-utils.d.ts +1 -1
- package/dist/lang/ast/fragtype-utils.js +15 -15
- package/dist/lang/ast/index.d.ts +90 -90
- package/dist/lang/ast/parameters/constant-parameter.d.ts +3 -3
- package/dist/lang/ast/parameters/constant-parameter.js +10 -10
- package/dist/lang/ast/parameters/has-parameter.d.ts +3 -3
- package/dist/lang/ast/parameters/has-parameter.js +7 -7
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +3 -3
- package/dist/lang/ast/query-elements/anonymous-query.js +2 -2
- package/dist/lang/ast/query-elements/existing-query.d.ts +4 -4
- package/dist/lang/ast/query-elements/existing-query.js +10 -10
- package/dist/lang/ast/query-elements/full-query.d.ts +4 -4
- package/dist/lang/ast/query-elements/full-query.js +10 -10
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +2 -2
- package/dist/lang/ast/query-elements/query-head-struct.js +2 -2
- package/dist/lang/ast/query-items/field-declaration.d.ts +6 -6
- package/dist/lang/ast/query-items/field-declaration.js +14 -14
- package/dist/lang/ast/query-items/field-references.d.ts +6 -6
- package/dist/lang/ast/query-items/field-references.js +9 -9
- package/dist/lang/ast/query-properties/aggregate.d.ts +2 -2
- package/dist/lang/ast/query-properties/aggregate.js +1 -1
- package/dist/lang/ast/query-properties/declare-fields.d.ts +2 -2
- package/dist/lang/ast/query-properties/declare-fields.js +1 -1
- package/dist/lang/ast/query-properties/dimmensions.d.ts +2 -2
- package/dist/lang/ast/query-properties/dimmensions.js +1 -1
- package/dist/lang/ast/query-properties/filters.d.ts +4 -4
- package/dist/lang/ast/query-properties/filters.js +16 -16
- package/dist/lang/ast/query-properties/group-by.d.ts +2 -2
- package/dist/lang/ast/query-properties/group-by.js +1 -1
- package/dist/lang/ast/query-properties/indexing.d.ts +3 -3
- package/dist/lang/ast/query-properties/indexing.js +3 -3
- package/dist/lang/ast/query-properties/joins.d.ts +6 -6
- package/dist/lang/ast/query-properties/joins.js +27 -27
- package/dist/lang/ast/query-properties/limit.d.ts +1 -1
- package/dist/lang/ast/query-properties/limit.js +1 -1
- package/dist/lang/ast/query-properties/measures.d.ts +2 -2
- package/dist/lang/ast/query-properties/measures.js +1 -1
- package/dist/lang/ast/query-properties/nest-reference.d.ts +2 -2
- package/dist/lang/ast/query-properties/nest-reference.js +1 -1
- package/dist/lang/ast/query-properties/nest.d.ts +7 -7
- package/dist/lang/ast/query-properties/nest.js +7 -7
- package/dist/lang/ast/query-properties/nests.d.ts +2 -2
- package/dist/lang/ast/query-properties/nests.js +1 -1
- package/dist/lang/ast/query-properties/ordering.d.ts +3 -3
- package/dist/lang/ast/query-properties/ordering.js +6 -6
- package/dist/lang/ast/query-properties/project-statement.d.ts +2 -2
- package/dist/lang/ast/query-properties/project-statement.js +1 -1
- package/dist/lang/ast/query-properties/qop-desc.d.ts +7 -7
- package/dist/lang/ast/query-properties/qop-desc.js +20 -20
- package/dist/lang/ast/query-properties/sampling.d.ts +2 -2
- package/dist/lang/ast/query-properties/sampling.js +1 -1
- package/dist/lang/ast/query-properties/top.d.ts +4 -4
- package/dist/lang/ast/query-properties/top.js +5 -5
- package/dist/lang/ast/source-properties/field-list-edit.d.ts +4 -4
- package/dist/lang/ast/source-properties/field-list-edit.js +2 -2
- package/dist/lang/ast/source-properties/primary-key.d.ts +2 -2
- package/dist/lang/ast/source-properties/primary-key.js +2 -2
- package/dist/lang/ast/source-properties/renames.d.ts +2 -2
- package/dist/lang/ast/source-properties/renames.js +3 -3
- package/dist/lang/ast/source-properties/turtles.d.ts +2 -2
- package/dist/lang/ast/source-properties/turtles.js +1 -1
- package/dist/lang/ast/sources/named-source.d.ts +4 -4
- package/dist/lang/ast/sources/named-source.js +5 -5
- package/dist/lang/ast/sources/query-source.d.ts +3 -3
- package/dist/lang/ast/sources/query-source.js +3 -3
- package/dist/lang/ast/sources/sql-source.d.ts +2 -2
- package/dist/lang/ast/sources/sql-source.js +2 -2
- package/dist/lang/ast/sources/table-source.d.ts +2 -2
- package/dist/lang/ast/sources/table-source.js +7 -7
- package/dist/lang/ast/space-seed.d.ts +2 -2
- package/dist/lang/ast/space-seed.js +1 -1
- package/dist/lang/ast/sql-elements/sql-statement.d.ts +4 -4
- package/dist/lang/ast/sql-elements/sql-statement.js +9 -9
- package/dist/lang/ast/sql-elements/sql-string.d.ts +3 -3
- package/dist/lang/ast/sql-elements/sql-string.js +6 -6
- package/dist/lang/ast/struct-utils.d.ts +2 -2
- package/dist/lang/ast/struct-utils.js +3 -3
- package/dist/lang/ast/time-utils.d.ts +6 -6
- package/dist/lang/ast/time-utils.js +46 -46
- package/dist/lang/ast/types/document-compile-result.d.ts +2 -2
- package/dist/lang/ast/types/executor.d.ts +3 -3
- package/dist/lang/ast/types/explore-desc.d.ts +2 -2
- package/dist/lang/ast/types/explore-desc.js +1 -1
- package/dist/lang/ast/types/explore-field.d.ts +3 -3
- package/dist/lang/ast/types/expr-result.d.ts +2 -2
- package/dist/lang/ast/types/expr-value.d.ts +2 -2
- package/dist/lang/ast/types/expression-def.d.ts +4 -4
- package/dist/lang/ast/types/expression-def.js +86 -86
- package/dist/lang/ast/types/field-collection-member.d.ts +3 -3
- package/dist/lang/ast/types/field-decl.d.ts +5 -5
- package/dist/lang/ast/types/field-space.d.ts +5 -5
- package/dist/lang/ast/types/field-space.js +1 -1
- package/dist/lang/ast/types/granular-result.d.ts +3 -3
- package/dist/lang/ast/types/granular-result.js +1 -1
- package/dist/lang/ast/types/lookup-result.d.ts +1 -1
- package/dist/lang/ast/types/malloy-element.d.ts +6 -6
- package/dist/lang/ast/types/malloy-element.js +49 -49
- package/dist/lang/ast/types/model-entry.d.ts +1 -1
- package/dist/lang/ast/types/name-space.d.ts +1 -1
- package/dist/lang/ast/types/nested-query.d.ts +2 -2
- package/dist/lang/ast/types/op-desc.d.ts +2 -2
- package/dist/lang/ast/types/query-comp.d.ts +1 -1
- package/dist/lang/ast/types/query-element.d.ts +3 -3
- package/dist/lang/ast/types/query-item.d.ts +4 -4
- package/dist/lang/ast/types/query-property.d.ts +15 -15
- package/dist/lang/ast/types/source-property.d.ts +8 -8
- package/dist/lang/ast/types/space-entry.d.ts +2 -2
- package/dist/lang/ast/types/space-field.d.ts +4 -4
- package/dist/lang/ast/types/space-field.js +4 -4
- package/dist/lang/ast/types/space-param.d.ts +4 -4
- package/dist/lang/ast/types/space-param.js +4 -4
- package/dist/lang/ast/types/time-result.d.ts +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
- package/dist/lang/ast/types/type-desc.d.ts +3 -3
- package/dist/lang/field-utils.d.ts +1 -1
- package/dist/lang/field-utils.js +4 -4
- package/dist/lang/index.d.ts +10 -10
- package/dist/lang/malloy-to-ast.d.ts +8 -8
- package/dist/lang/malloy-to-ast.js +68 -68
- package/dist/lang/parse-error-handler.d.ts +3 -3
- package/dist/lang/parse-error-handler.js +4 -4
- package/dist/lang/parse-log.d.ts +2 -2
- package/dist/lang/parse-log.js +1 -1
- package/dist/lang/parse-malloy.d.ts +7 -7
- package/dist/lang/parse-malloy.js +81 -81
- package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +2 -2
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +38 -38
- package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +1 -1
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +14 -14
- package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +3 -3
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -85
- package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +4 -4
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +3 -3
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +3 -3
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +4 -4
- package/dist/lang/parse-tree-walkers/find-external-references.js +2 -2
- package/dist/lang/reference-list.d.ts +1 -1
- package/dist/lang/test/document-help-context-walker.spec.js +9 -9
- package/dist/lang/test/document-symbol-walker.spec.js +32 -32
- package/dist/lang/test/field-symbols.spec.js +87 -87
- package/dist/lang/test/parse.spec.d.ts +1 -1
- package/dist/lang/test/parse.spec.js +768 -768
- package/dist/lang/test/test-translator.d.ts +6 -6
- package/dist/lang/test/test-translator.js +159 -159
- package/dist/lang/translate-response.d.ts +7 -7
- package/dist/lang/translate-response.js +1 -1
- package/dist/lang/zone.d.ts +5 -5
- package/dist/lang/zone.js +8 -8
- package/dist/malloy.d.ts +7 -7
- package/dist/malloy.js +192 -192
- package/dist/model/index.d.ts +2 -2
- package/dist/model/malloy_query.d.ts +12 -12
- package/dist/model/malloy_query.js +497 -502
- package/dist/model/malloy_types.d.ts +68 -68
- package/dist/model/malloy_types.js +102 -102
- package/dist/model/sql_block.d.ts +1 -1
- package/dist/model/sql_block.js +4 -4
- package/dist/model/utils.d.ts +1 -1
- package/dist/model/utils.js +10 -10
- package/dist/runtime_types.d.ts +2 -2
- package/package.json +4 -1
|
@@ -34,23 +34,23 @@ interface DocumentReferenceBase {
|
|
|
34
34
|
definition: HasLocation;
|
|
35
35
|
}
|
|
36
36
|
export interface DocumentExploreReference extends DocumentReferenceBase {
|
|
37
|
-
type:
|
|
37
|
+
type: 'exploreReference';
|
|
38
38
|
definition: StructDef;
|
|
39
39
|
}
|
|
40
40
|
export interface DocumentJoinReference extends DocumentReferenceBase {
|
|
41
|
-
type:
|
|
41
|
+
type: 'joinReference';
|
|
42
42
|
definition: FieldDef;
|
|
43
43
|
}
|
|
44
44
|
export interface DocumentSQLBlockReference extends DocumentReferenceBase {
|
|
45
|
-
type:
|
|
45
|
+
type: 'sqlBlockReference';
|
|
46
46
|
definition: SQLBlockStructDef;
|
|
47
47
|
}
|
|
48
48
|
export interface DocumentQueryReference extends DocumentReferenceBase {
|
|
49
|
-
type:
|
|
49
|
+
type: 'queryReference';
|
|
50
50
|
definition: Query;
|
|
51
51
|
}
|
|
52
52
|
export interface DocumentFieldReference extends DocumentReferenceBase {
|
|
53
|
-
type:
|
|
53
|
+
type: 'fieldReference';
|
|
54
54
|
definition: FieldDef;
|
|
55
55
|
}
|
|
56
56
|
export declare type DocumentReference = DocumentExploreReference | DocumentQueryReference | DocumentSQLBlockReference | DocumentFieldReference | DocumentJoinReference;
|
|
@@ -79,7 +79,7 @@ export interface ResultMetadataDef {
|
|
|
79
79
|
sourceExpression?: string;
|
|
80
80
|
sourceClasses: string[];
|
|
81
81
|
filterList?: FilterExpression[];
|
|
82
|
-
fieldKind:
|
|
82
|
+
fieldKind: 'measure' | 'dimension' | 'struct';
|
|
83
83
|
}
|
|
84
84
|
export interface ResultStructMetadataDef extends ResultMetadataDef {
|
|
85
85
|
limit?: number;
|
|
@@ -91,14 +91,14 @@ export interface ResultStructMetadata {
|
|
|
91
91
|
resultMetadata?: ResultStructMetadataDef;
|
|
92
92
|
}
|
|
93
93
|
export interface FilterFragment {
|
|
94
|
-
type:
|
|
94
|
+
type: 'filterExpression';
|
|
95
95
|
filterList: FilterExpression[];
|
|
96
96
|
e: Expr;
|
|
97
97
|
}
|
|
98
98
|
export declare function isFilterFragment(f: Fragment): f is FilterFragment;
|
|
99
99
|
export declare function isDialectFragment(f: Fragment): f is DialectFragment;
|
|
100
100
|
export interface AggregateFragment {
|
|
101
|
-
type:
|
|
101
|
+
type: 'aggregate';
|
|
102
102
|
function: string;
|
|
103
103
|
e: Expr;
|
|
104
104
|
structPath?: string;
|
|
@@ -106,100 +106,100 @@ export interface AggregateFragment {
|
|
|
106
106
|
export declare function isAggregateFragment(f: Fragment): f is AggregateFragment;
|
|
107
107
|
export declare function isAsymmetricFragment(f: Fragment): f is AggregateFragment;
|
|
108
108
|
export interface UngroupFragment {
|
|
109
|
-
type:
|
|
109
|
+
type: 'all' | 'exclude';
|
|
110
110
|
e: Expr;
|
|
111
111
|
fields?: string[];
|
|
112
112
|
}
|
|
113
113
|
export declare function isUngroupFragment(f: Fragment): f is UngroupFragment;
|
|
114
|
-
export declare type MalloyFunctionParam = AtomicFieldType |
|
|
114
|
+
export declare type MalloyFunctionParam = AtomicFieldType | 'any' | 'nconst' | 'regexp';
|
|
115
115
|
export interface MalloyFunctionInfo {
|
|
116
116
|
returnType: AtomicFieldType;
|
|
117
|
-
parameters:
|
|
118
|
-
expressionType?:
|
|
117
|
+
parameters: 'any' | 'none' | MalloyFunctionParam[];
|
|
118
|
+
expressionType?: 'aggregate' | 'analytic';
|
|
119
119
|
sqlName?: string;
|
|
120
120
|
}
|
|
121
121
|
export declare const malloyFunctions: Record<string, MalloyFunctionInfo>;
|
|
122
122
|
export interface AnalyticFragment {
|
|
123
|
-
type:
|
|
123
|
+
type: 'analytic';
|
|
124
124
|
function: string;
|
|
125
125
|
parameters?: (string | number | Expr)[];
|
|
126
126
|
}
|
|
127
127
|
export declare function isAnalyticFragment(f: Fragment): f is AnalyticFragment;
|
|
128
128
|
export interface FieldFragment {
|
|
129
|
-
type:
|
|
129
|
+
type: 'field';
|
|
130
130
|
path: string;
|
|
131
131
|
}
|
|
132
132
|
export declare function isFieldFragment(f: Fragment): f is FieldFragment;
|
|
133
133
|
export interface ParameterFragment {
|
|
134
|
-
type:
|
|
134
|
+
type: 'parameter';
|
|
135
135
|
path: string;
|
|
136
136
|
}
|
|
137
137
|
export declare function isParameterFragment(f: Fragment): f is ParameterFragment;
|
|
138
138
|
export interface ApplyValueFragment {
|
|
139
|
-
type:
|
|
139
|
+
type: 'applyVal';
|
|
140
140
|
}
|
|
141
141
|
export declare function isApplyValue(f: Fragment): f is ApplyValueFragment;
|
|
142
142
|
export interface ApplyFragment {
|
|
143
|
-
type:
|
|
143
|
+
type: 'apply';
|
|
144
144
|
value: Expr;
|
|
145
145
|
to: Expr;
|
|
146
146
|
}
|
|
147
147
|
export declare function isApplyFragment(f: Fragment): f is ApplyFragment;
|
|
148
148
|
interface DialectFragmentBase {
|
|
149
|
-
type:
|
|
149
|
+
type: 'dialect';
|
|
150
150
|
function: string;
|
|
151
151
|
}
|
|
152
152
|
export interface NowFragment extends DialectFragmentBase {
|
|
153
|
-
function:
|
|
153
|
+
function: 'now';
|
|
154
154
|
}
|
|
155
155
|
export interface TimeDiffFragment extends DialectFragmentBase {
|
|
156
|
-
function:
|
|
156
|
+
function: 'timeDiff';
|
|
157
157
|
units: TimestampUnit;
|
|
158
158
|
left: TimeValue;
|
|
159
159
|
right: TimeValue;
|
|
160
160
|
}
|
|
161
161
|
export interface TimeDeltaFragment extends DialectFragmentBase {
|
|
162
|
-
function:
|
|
162
|
+
function: 'delta';
|
|
163
163
|
base: TimeValue;
|
|
164
|
-
op:
|
|
164
|
+
op: '+' | '-';
|
|
165
165
|
delta: Expr;
|
|
166
166
|
units: TimestampUnit;
|
|
167
167
|
}
|
|
168
168
|
export interface TimeTruncFragment extends DialectFragmentBase {
|
|
169
|
-
function:
|
|
169
|
+
function: 'trunc';
|
|
170
170
|
expr: TimeValue;
|
|
171
171
|
units: TimestampUnit;
|
|
172
172
|
}
|
|
173
173
|
export interface TimeExtractFragment extends DialectFragmentBase {
|
|
174
|
-
function:
|
|
174
|
+
function: 'extract';
|
|
175
175
|
expr: TimeValue;
|
|
176
176
|
units: ExtractUnit;
|
|
177
177
|
}
|
|
178
178
|
export interface TypecastFragment extends DialectFragmentBase {
|
|
179
|
-
function:
|
|
179
|
+
function: 'cast';
|
|
180
180
|
safe: boolean;
|
|
181
181
|
expr: Expr;
|
|
182
182
|
dstType: AtomicFieldType;
|
|
183
183
|
srcType?: AtomicFieldType;
|
|
184
184
|
}
|
|
185
185
|
export interface RegexpMatchFragment extends DialectFragmentBase {
|
|
186
|
-
function:
|
|
186
|
+
function: 'regexpMatch';
|
|
187
187
|
expr: Expr;
|
|
188
188
|
regexp: string;
|
|
189
189
|
}
|
|
190
190
|
export interface DivFragment extends DialectFragmentBase {
|
|
191
|
-
function:
|
|
191
|
+
function: 'div';
|
|
192
192
|
numerator: Expr;
|
|
193
193
|
denominator: Expr;
|
|
194
194
|
}
|
|
195
195
|
export interface TimeLiteralFragment extends DialectFragmentBase {
|
|
196
|
-
function:
|
|
196
|
+
function: 'timeLiteral';
|
|
197
197
|
literal: string;
|
|
198
198
|
literalType: TimeFieldType;
|
|
199
199
|
timezone: string;
|
|
200
200
|
}
|
|
201
201
|
export interface StringLiteralFragment extends DialectFragmentBase {
|
|
202
|
-
function:
|
|
202
|
+
function: 'stringLiteral';
|
|
203
203
|
literal: string;
|
|
204
204
|
}
|
|
205
205
|
export declare type DialectFragment = DivFragment | TimeLiteralFragment | NowFragment | TimeDeltaFragment | TimeDiffFragment | TimeTruncFragment | TypecastFragment | TimeExtractFragment | StringLiteralFragment | RegexpMatchFragment;
|
|
@@ -224,7 +224,7 @@ declare type TagElement = Expr | string;
|
|
|
224
224
|
* ```
|
|
225
225
|
*/
|
|
226
226
|
export declare function mkExpr(src: TemplateStringsArray, ...exprs: TagElement[]): Expr;
|
|
227
|
-
export declare type ExpressionType =
|
|
227
|
+
export declare type ExpressionType = 'scalar' | 'aggregate' | 'analytic';
|
|
228
228
|
export interface Expression {
|
|
229
229
|
e?: Expr;
|
|
230
230
|
expressionType?: ExpressionType;
|
|
@@ -239,9 +239,9 @@ interface JustExpression {
|
|
|
239
239
|
declare type HasExpression = FieldDef & JustExpression;
|
|
240
240
|
/** Grants access to the expression property of a FielfDef */
|
|
241
241
|
export declare function hasExpression(f: FieldDef): f is HasExpression;
|
|
242
|
-
export declare type TimeFieldType =
|
|
242
|
+
export declare type TimeFieldType = 'date' | 'timestamp';
|
|
243
243
|
export declare function isTimeFieldType(s: string): s is TimeFieldType;
|
|
244
|
-
export declare type AtomicFieldType =
|
|
244
|
+
export declare type AtomicFieldType = 'string' | 'number' | TimeFieldType | 'boolean' | 'unsupported' | 'json';
|
|
245
245
|
export declare function isAtomicFieldType(s: string): s is AtomicFieldType;
|
|
246
246
|
/** All scalars can have an optional expression */
|
|
247
247
|
export interface FieldAtomicDef extends NamedObject, Expression, ResultMetadata {
|
|
@@ -250,33 +250,33 @@ export interface FieldAtomicDef extends NamedObject, Expression, ResultMetadata
|
|
|
250
250
|
export declare function FieldIsIntrinsic(f: FieldDef): boolean;
|
|
251
251
|
/** Scalar String Field */
|
|
252
252
|
export interface FieldStringDef extends FieldAtomicDef {
|
|
253
|
-
type:
|
|
253
|
+
type: 'string';
|
|
254
254
|
bucketFilter?: string;
|
|
255
255
|
bucketOther?: string;
|
|
256
256
|
}
|
|
257
257
|
/** Scalar Numeric String Field */
|
|
258
258
|
export interface FieldNumberDef extends FieldAtomicDef {
|
|
259
|
-
type:
|
|
260
|
-
numberType?:
|
|
259
|
+
type: 'number';
|
|
260
|
+
numberType?: 'integer' | 'float';
|
|
261
261
|
}
|
|
262
262
|
/** Scalar Boolean Field */
|
|
263
263
|
export interface FieldBooleanDef extends FieldAtomicDef {
|
|
264
|
-
type:
|
|
264
|
+
type: 'boolean';
|
|
265
265
|
}
|
|
266
266
|
/** Scalar JSON Field */
|
|
267
267
|
export interface FieldJSONDef extends FieldAtomicDef {
|
|
268
|
-
type:
|
|
268
|
+
type: 'json';
|
|
269
269
|
}
|
|
270
270
|
/** Scalar unsupported Field */
|
|
271
271
|
export interface FieldUnsupportedDef extends FieldAtomicDef {
|
|
272
|
-
type:
|
|
272
|
+
type: 'unsupported';
|
|
273
273
|
rawType?: string;
|
|
274
274
|
}
|
|
275
|
-
export declare type DateUnit =
|
|
275
|
+
export declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
276
276
|
export declare function isDateUnit(str: string): str is DateUnit;
|
|
277
|
-
export declare type TimestampUnit = DateUnit |
|
|
277
|
+
export declare type TimestampUnit = DateUnit | 'hour' | 'minute' | 'second';
|
|
278
278
|
export declare function isTimestampUnit(s: string): s is TimestampUnit;
|
|
279
|
-
export declare type ExtractUnit = TimestampUnit |
|
|
279
|
+
export declare type ExtractUnit = TimestampUnit | 'day_of_week' | 'day_of_year';
|
|
280
280
|
export declare function isExtractUnit(s: string): s is ExtractUnit;
|
|
281
281
|
/** Value types distinguished by their usage in generated SQL, particularly with respect to filters. */
|
|
282
282
|
export declare enum ValueType {
|
|
@@ -288,25 +288,25 @@ export declare enum ValueType {
|
|
|
288
288
|
export declare type TimeValueType = ValueType.Date | ValueType.Timestamp;
|
|
289
289
|
/** Scalar Date Field. */
|
|
290
290
|
export interface FieldDateDef extends FieldAtomicDef {
|
|
291
|
-
type:
|
|
291
|
+
type: 'date';
|
|
292
292
|
timeframe?: DateUnit;
|
|
293
293
|
}
|
|
294
294
|
/** Scalar Timestamp Field */
|
|
295
295
|
export interface FieldTimestampDef extends FieldAtomicDef {
|
|
296
|
-
type:
|
|
296
|
+
type: 'timestamp';
|
|
297
297
|
timeframe?: TimestampUnit;
|
|
298
298
|
}
|
|
299
299
|
/** parameter to order a query */
|
|
300
300
|
export interface OrderBy {
|
|
301
301
|
field: string | number;
|
|
302
|
-
dir?:
|
|
302
|
+
dir?: 'asc' | 'desc';
|
|
303
303
|
}
|
|
304
304
|
export interface ByName {
|
|
305
|
-
by:
|
|
305
|
+
by: 'name';
|
|
306
306
|
name: string;
|
|
307
307
|
}
|
|
308
308
|
export interface ByExpression {
|
|
309
|
-
by:
|
|
309
|
+
by: 'expression';
|
|
310
310
|
e: Expr;
|
|
311
311
|
}
|
|
312
312
|
export declare type By = ByName | ByExpression;
|
|
@@ -335,17 +335,17 @@ export interface Pipeline {
|
|
|
335
335
|
pipeline: PipeSegment[];
|
|
336
336
|
}
|
|
337
337
|
export interface Query extends Pipeline, Filtered, HasLocation {
|
|
338
|
-
type?:
|
|
338
|
+
type?: 'query';
|
|
339
339
|
structRef: StructRef;
|
|
340
340
|
}
|
|
341
341
|
export declare type NamedQuery = Query & NamedObject;
|
|
342
342
|
export declare type PipeSegment = QuerySegment | IndexSegment;
|
|
343
343
|
export interface ReduceSegment extends QuerySegment {
|
|
344
|
-
type:
|
|
344
|
+
type: 'reduce';
|
|
345
345
|
}
|
|
346
346
|
export declare function isReduceSegment(pe: PipeSegment): pe is ReduceSegment;
|
|
347
347
|
export interface ProjectSegment extends QuerySegment {
|
|
348
|
-
type:
|
|
348
|
+
type: 'project';
|
|
349
349
|
}
|
|
350
350
|
export declare function isProjectSegment(pe: PipeSegment): pe is ProjectSegment;
|
|
351
351
|
export declare function isQuerySegment(pe: PipeSegment): pe is QuerySegment;
|
|
@@ -363,7 +363,7 @@ interface SamplingEnable {
|
|
|
363
363
|
}
|
|
364
364
|
export declare function isSamplingEnable(s: Sampling): s is SamplingEnable;
|
|
365
365
|
export interface IndexSegment extends Filtered {
|
|
366
|
-
type:
|
|
366
|
+
type: 'index';
|
|
367
367
|
fields: string[];
|
|
368
368
|
limit?: number;
|
|
369
369
|
weightMeasure?: string;
|
|
@@ -371,7 +371,7 @@ export interface IndexSegment extends Filtered {
|
|
|
371
371
|
}
|
|
372
372
|
export declare function isIndexSegment(pe: PipeSegment): pe is IndexSegment;
|
|
373
373
|
export interface QuerySegment extends Filtered {
|
|
374
|
-
type:
|
|
374
|
+
type: 'reduce' | 'project';
|
|
375
375
|
fields: QueryFieldDef[];
|
|
376
376
|
extendSource?: FieldDef[];
|
|
377
377
|
limit?: number;
|
|
@@ -379,22 +379,22 @@ export interface QuerySegment extends Filtered {
|
|
|
379
379
|
orderBy?: OrderBy[];
|
|
380
380
|
}
|
|
381
381
|
export interface TurtleDef extends NamedObject, Pipeline {
|
|
382
|
-
type:
|
|
382
|
+
type: 'turtle';
|
|
383
383
|
}
|
|
384
|
-
export declare type JoinRelationship =
|
|
384
|
+
export declare type JoinRelationship = 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
|
|
385
385
|
export interface JoinOn {
|
|
386
|
-
type:
|
|
386
|
+
type: 'one' | 'many' | 'cross';
|
|
387
387
|
onExpression?: Expr;
|
|
388
388
|
}
|
|
389
389
|
export declare function isJoinOn(sr: StructRelationship): sr is JoinOn;
|
|
390
390
|
/** types of joins. */
|
|
391
391
|
export declare type StructRelationship = {
|
|
392
|
-
type:
|
|
392
|
+
type: 'basetable';
|
|
393
393
|
connectionName: string;
|
|
394
394
|
} | JoinOn | {
|
|
395
|
-
type:
|
|
395
|
+
type: 'inline';
|
|
396
396
|
} | {
|
|
397
|
-
type:
|
|
397
|
+
type: 'nested';
|
|
398
398
|
field: FieldRef;
|
|
399
399
|
isArray: boolean;
|
|
400
400
|
};
|
|
@@ -414,35 +414,35 @@ export interface SQLBlockSource {
|
|
|
414
414
|
select: SQLPhrase[];
|
|
415
415
|
}
|
|
416
416
|
export interface SQLBlock extends NamedObject {
|
|
417
|
-
type:
|
|
417
|
+
type: 'sqlBlock';
|
|
418
418
|
connection?: string;
|
|
419
419
|
selectStr: string;
|
|
420
420
|
}
|
|
421
421
|
interface SubquerySource {
|
|
422
|
-
type:
|
|
423
|
-
method:
|
|
422
|
+
type: 'sql';
|
|
423
|
+
method: 'subquery';
|
|
424
424
|
sqlBlock: SQLBlock;
|
|
425
425
|
}
|
|
426
426
|
/** where does the struct come from? */
|
|
427
427
|
export declare type StructSource = {
|
|
428
|
-
type:
|
|
428
|
+
type: 'table';
|
|
429
429
|
tablePath: string;
|
|
430
430
|
} | {
|
|
431
|
-
type:
|
|
431
|
+
type: 'nested';
|
|
432
432
|
} | {
|
|
433
|
-
type:
|
|
433
|
+
type: 'inline';
|
|
434
434
|
} | {
|
|
435
|
-
type:
|
|
435
|
+
type: 'query';
|
|
436
436
|
query: Query;
|
|
437
437
|
} | {
|
|
438
|
-
type:
|
|
439
|
-
method:
|
|
438
|
+
type: 'sql';
|
|
439
|
+
method: 'nested' | 'lastStage';
|
|
440
440
|
} | {
|
|
441
|
-
type:
|
|
441
|
+
type: 'query_result';
|
|
442
442
|
} | SubquerySource;
|
|
443
443
|
/** struct that is intrinsic to the table */
|
|
444
444
|
export interface StructDef extends NamedObject, ResultStructMetadata, Filtered {
|
|
445
|
-
type:
|
|
445
|
+
type: 'struct';
|
|
446
446
|
structSource: StructSource;
|
|
447
447
|
structRelationship: StructRelationship;
|
|
448
448
|
fields: FieldDef[];
|