@malloydata/malloy 0.0.22-dev230126015148 → 0.0.22-dev230202171033
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/lang/ast/ast-main.d.ts +18 -815
- package/dist/lang/ast/ast-main.js +106 -3241
- package/dist/lang/ast/ast-utils.d.ts +10 -0
- package/dist/lang/ast/ast-utils.js +42 -0
- package/dist/lang/ast/elements/define-explore.d.ts +17 -0
- package/dist/lang/ast/elements/define-explore.js +79 -0
- package/dist/lang/ast/elements/define-query.d.ts +14 -0
- package/dist/lang/ast/elements/define-query.js +56 -0
- package/dist/lang/ast/elements/mallobj.d.ts +12 -0
- package/dist/lang/ast/elements/mallobj.js +53 -0
- package/dist/lang/ast/elements/pipeline-desc.d.ts +28 -0
- package/dist/lang/ast/elements/pipeline-desc.js +102 -0
- package/dist/lang/ast/elements/refined-explore.d.ts +15 -0
- package/dist/lang/ast/elements/refined-explore.js +121 -0
- package/dist/lang/ast/error-factory.d.ts +9 -0
- package/dist/lang/ast/error-factory.js +61 -0
- package/dist/lang/ast/executors/index-executor.d.ts +18 -0
- package/dist/lang/ast/executors/index-executor.js +96 -0
- package/dist/lang/ast/executors/project-executor.d.ts +10 -0
- package/dist/lang/ast/executors/project-executor.js +68 -0
- package/dist/lang/ast/executors/reduce-executor.d.ts +20 -0
- package/dist/lang/ast/executors/reduce-executor.js +149 -0
- package/dist/lang/ast/explore-properties/field-list-edit.d.ts +8 -0
- package/dist/lang/ast/explore-properties/field-list-edit.js +36 -0
- package/dist/lang/ast/explore-properties/primary-key.d.ts +7 -0
- package/dist/lang/ast/{apply-expr.js → explore-properties/primary-key.js} +9 -8
- package/dist/lang/ast/explore-properties/renames.d.ts +11 -0
- package/dist/lang/ast/explore-properties/renames.js +43 -0
- package/dist/lang/ast/explore-properties/turtles.d.ts +5 -0
- package/dist/lang/ast/explore-properties/turtles.js +33 -0
- package/dist/lang/ast/expressions/apply.d.ts +8 -0
- package/dist/lang/ast/expressions/apply.js +37 -0
- package/dist/lang/ast/expressions/binary-boolean.d.ts +12 -0
- package/dist/lang/ast/expressions/binary-boolean.js +54 -0
- package/dist/lang/ast/expressions/binary-numeric.d.ts +11 -0
- package/dist/lang/ast/expressions/binary-numeric.js +42 -0
- package/dist/lang/ast/expressions/boolean.d.ts +8 -0
- package/dist/lang/ast/expressions/boolean.js +39 -0
- package/dist/lang/ast/expressions/constant-sub-expression.d.ts +16 -0
- package/dist/lang/ast/expressions/constant-sub-expression.js +98 -0
- package/dist/lang/ast/expressions/expr-add-sub.d.ts +4 -0
- package/dist/lang/ast/expressions/expr-add-sub.js +34 -0
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +15 -0
- package/dist/lang/ast/expressions/expr-aggregate-function.js +99 -0
- package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-alternation-tree.js +54 -0
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-asymmetric.js +27 -0
- package/dist/lang/ast/expressions/expr-avg.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-avg.js +34 -0
- package/dist/lang/ast/expressions/expr-case.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-case.js +84 -0
- package/dist/lang/ast/expressions/expr-cast.d.ts +13 -0
- package/dist/lang/ast/expressions/expr-cast.js +29 -0
- package/dist/lang/ast/expressions/expr-compare.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-compare.js +48 -0
- package/dist/lang/ast/expressions/expr-count-distinct.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-count-distinct.js +35 -0
- package/dist/lang/ast/expressions/expr-count.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-count.js +57 -0
- package/dist/lang/ast/expressions/expr-filter.d.ts +12 -0
- package/dist/lang/ast/expressions/expr-filter.js +69 -0
- package/dist/lang/ast/expressions/expr-func.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-func.js +63 -0
- package/dist/lang/ast/expressions/expr-granular-time.d.ts +24 -0
- package/dist/lang/ast/expressions/expr-granular-time.js +117 -0
- package/dist/lang/ast/expressions/expr-id-reference.d.ts +12 -0
- package/dist/lang/ast/expressions/expr-id-reference.js +76 -0
- package/dist/lang/ast/expressions/expr-logical-op.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-logical-op.js +36 -0
- package/dist/lang/ast/expressions/expr-max.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-max.js +16 -0
- package/dist/lang/ast/expressions/expr-min.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-min.js +16 -0
- package/dist/lang/ast/expressions/expr-minus.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-minus.js +48 -0
- package/dist/lang/ast/expressions/expr-mul-div.d.ts +4 -0
- package/dist/lang/ast/expressions/expr-mul-div.js +34 -0
- package/dist/lang/ast/expressions/expr-not.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-not.js +49 -0
- package/dist/lang/ast/expressions/expr-now.d.ts +7 -0
- package/dist/lang/ast/expressions/expr-now.js +46 -0
- package/dist/lang/ast/expressions/expr-null.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-null.js +41 -0
- package/dist/lang/ast/expressions/expr-number.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-number.js +42 -0
- package/dist/lang/ast/expressions/expr-parens.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-parens.js +42 -0
- package/dist/lang/ast/expressions/expr-regex.d.ts +8 -0
- package/dist/lang/ast/expressions/expr-regex.js +42 -0
- package/dist/lang/ast/expressions/expr-string.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-string.js +50 -0
- package/dist/lang/ast/expressions/expr-sum.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-sum.js +12 -0
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +13 -0
- package/dist/lang/ast/expressions/expr-time-extract.js +117 -0
- package/dist/lang/ast/expressions/expr-time.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-time.js +62 -0
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +14 -0
- package/dist/lang/ast/expressions/expr-ungroup.js +83 -0
- package/dist/lang/ast/expressions/for-range.d.ts +19 -0
- package/dist/lang/ast/expressions/for-range.js +101 -0
- package/dist/lang/ast/expressions/granular-literal.d.ts +20 -0
- package/dist/lang/ast/expressions/granular-literal.js +148 -0
- package/dist/lang/ast/expressions/partial-compare.d.ts +14 -0
- package/dist/lang/ast/expressions/partial-compare.js +50 -0
- package/dist/lang/ast/expressions/pick-when.d.ts +19 -0
- package/dist/lang/ast/expressions/pick-when.js +156 -0
- package/dist/lang/ast/expressions/range.d.ts +12 -0
- package/dist/lang/ast/expressions/range.js +80 -0
- package/dist/lang/ast/expressions/time-frame.d.ts +7 -0
- package/dist/lang/ast/expressions/time-frame.js +40 -0
- package/dist/lang/ast/expressions/top-by.d.ts +10 -0
- package/dist/lang/ast/expressions/top-by.js +51 -0
- package/dist/lang/ast/expressions/unary.d.ts +5 -0
- package/dist/lang/ast/expressions/unary.js +34 -0
- package/dist/lang/ast/expressions/utils.d.ts +15 -0
- package/dist/lang/ast/expressions/utils.js +106 -0
- package/dist/lang/ast/expressions/when-clause.d.ts +10 -0
- package/dist/lang/ast/expressions/when-clause.js +17 -0
- package/dist/lang/ast/fragtype-utils.d.ts +39 -0
- package/dist/lang/ast/fragtype-utils.js +100 -0
- package/dist/lang/ast/import-elements/import-statement.d.ts +9 -0
- package/dist/lang/ast/import-elements/import-statement.js +78 -0
- package/dist/lang/ast/index.d.ts +94 -3
- package/dist/lang/ast/index.js +94 -3
- package/dist/lang/ast/json-elements/json-element.d.ts +6 -0
- package/dist/lang/ast/json-elements/json-element.js +41 -0
- package/dist/lang/ast/json-elements/json-struct-def.d.ts +10 -0
- package/dist/lang/ast/json-elements/json-struct-def.js +48 -0
- package/dist/lang/ast/nesting/nest-reference.d.ts +7 -0
- package/dist/lang/ast/nesting/nest-reference.js +35 -0
- package/dist/lang/ast/parameters/constant-parameter.d.ts +8 -0
- package/dist/lang/ast/parameters/constant-parameter.js +54 -0
- package/dist/lang/ast/parameters/has-parameter.d.ts +19 -0
- package/dist/lang/ast/parameters/has-parameter.js +64 -0
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +9 -0
- package/dist/lang/ast/query-elements/anonymous-query.js +41 -0
- package/dist/lang/ast/query-elements/existing-query.d.ts +11 -0
- package/dist/lang/ast/query-elements/existing-query.js +79 -0
- package/dist/lang/ast/query-elements/full-query.d.ts +10 -0
- package/dist/lang/ast/query-elements/full-query.js +85 -0
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +9 -0
- package/dist/lang/ast/query-elements/query-head-struct.js +48 -0
- package/dist/lang/ast/query-items/field-declaration.d.ts +31 -0
- package/dist/lang/ast/query-items/field-declaration.js +137 -0
- package/dist/lang/ast/query-items/field-references.d.ts +25 -0
- package/dist/lang/ast/query-items/field-references.js +80 -0
- package/dist/lang/ast/query-properties/aggregate.d.ts +5 -0
- package/dist/lang/ast/query-properties/aggregate.js +39 -0
- package/dist/lang/ast/query-properties/declare-fields.d.ts +5 -0
- package/dist/lang/ast/query-properties/declare-fields.js +33 -0
- package/dist/lang/ast/query-properties/dimmensions.d.ts +5 -0
- package/dist/lang/ast/query-properties/dimmensions.js +36 -0
- package/dist/lang/ast/query-properties/filters.d.ts +18 -0
- package/dist/lang/ast/query-properties/filters.js +89 -0
- package/dist/lang/ast/query-properties/group-by.d.ts +5 -0
- package/dist/lang/ast/query-properties/group-by.js +39 -0
- package/dist/lang/ast/query-properties/indexing.d.ts +10 -0
- package/dist/lang/ast/query-properties/indexing.js +39 -0
- package/dist/lang/ast/query-properties/joins.d.ts +36 -0
- package/dist/lang/ast/query-properties/joins.js +143 -0
- package/dist/lang/ast/query-properties/limit.d.ts +6 -0
- package/dist/lang/ast/query-properties/limit.js +35 -0
- package/dist/lang/ast/query-properties/measures.d.ts +5 -0
- package/dist/lang/ast/query-properties/measures.js +36 -0
- package/dist/lang/ast/query-properties/nests.d.ts +5 -0
- package/dist/lang/ast/query-properties/nests.js +33 -0
- package/dist/lang/ast/query-properties/ordering.d.ts +15 -0
- package/dist/lang/ast/query-properties/ordering.js +66 -0
- package/dist/lang/ast/query-properties/project-statement.d.ts +5 -0
- package/dist/lang/ast/query-properties/project-statement.js +33 -0
- package/dist/lang/ast/query-properties/qop-desc.d.ts +17 -0
- package/dist/lang/ast/query-properties/qop-desc.js +123 -0
- package/dist/lang/ast/query-properties/sampling.d.ts +8 -0
- package/dist/lang/ast/query-properties/sampling.js +38 -0
- package/dist/lang/ast/query-properties/top.d.ts +13 -0
- package/dist/lang/ast/query-properties/top.js +60 -0
- package/dist/lang/ast/result-spaces/index-field-space.d.ts +10 -0
- package/dist/lang/ast/result-spaces/index-field-space.js +57 -0
- package/dist/lang/ast/result-spaces/project-field-space.d.ts +6 -0
- package/dist/lang/ast/result-spaces/project-field-space.js +51 -0
- package/dist/lang/ast/result-spaces/reduce-field-space.d.ts +7 -0
- package/dist/lang/ast/result-spaces/reduce-field-space.js +37 -0
- package/dist/lang/ast/sources/named-source.d.ts +19 -0
- package/dist/lang/ast/sources/named-source.js +147 -0
- package/dist/lang/ast/sources/query-source.d.ts +9 -0
- package/dist/lang/ast/sources/query-source.js +41 -0
- package/dist/lang/ast/sources/sql-source.d.ts +7 -0
- package/dist/lang/ast/sources/sql-source.js +54 -0
- package/dist/lang/ast/sources/table-source.d.ts +8 -0
- package/dist/lang/ast/sources/table-source.js +60 -0
- package/dist/lang/ast/space-fields/column-space-field.d.ts +9 -0
- package/dist/lang/ast/space-fields/column-space-field.js +40 -0
- package/dist/lang/ast/space-fields/join-space-field.d.ts +8 -0
- package/dist/lang/ast/space-fields/join-space-field.js +35 -0
- package/dist/lang/ast/space-fields/query-field-struct.d.ts +10 -0
- package/dist/lang/ast/space-fields/query-field-struct.js +46 -0
- package/dist/lang/ast/space-fields/query-space-field.d.ts +11 -0
- package/dist/lang/ast/space-fields/query-space-field.js +37 -0
- package/dist/lang/ast/space-fields/reference-field.d.ts +11 -0
- package/dist/lang/ast/space-fields/reference-field.js +45 -0
- package/dist/lang/ast/space-fields/rename-space-field.d.ts +11 -0
- package/dist/lang/ast/space-fields/rename-space-field.js +50 -0
- package/dist/lang/ast/space-fields/wild-space-field.d.ts +10 -0
- package/dist/lang/ast/space-fields/wild-space-field.js +40 -0
- package/dist/lang/ast/space-parameters/abstract-parameter.d.ts +10 -0
- package/dist/lang/ast/space-parameters/abstract-parameter.js +41 -0
- package/dist/lang/ast/space-parameters/defined-parameter.d.ts +9 -0
- package/dist/lang/ast/space-parameters/defined-parameter.js +40 -0
- package/dist/lang/ast/space-seed.d.ts +17 -0
- package/dist/lang/ast/space-seed.js +59 -0
- package/dist/lang/ast/sql-elements/sql-statement.d.ts +19 -0
- package/dist/lang/ast/sql-elements/sql-statement.js +80 -0
- package/dist/lang/ast/sql-elements/sql-string.d.ts +12 -0
- package/dist/lang/ast/sql-elements/sql-string.js +60 -0
- package/dist/lang/ast/static-space.d.ts +33 -0
- package/dist/lang/ast/static-space.js +167 -0
- package/dist/lang/ast/struct-utils.d.ts +4 -0
- package/dist/lang/ast/struct-utils.js +48 -0
- package/dist/lang/ast/time-utils.d.ts +5 -2
- package/dist/lang/ast/time-utils.js +37 -1
- package/dist/lang/ast/types/comparison.d.ts +11 -0
- package/dist/lang/ast/types/comparison.js +41 -0
- package/dist/lang/ast/types/compart-types.d.ts +10 -0
- package/dist/lang/ast/types/compart-types.js +37 -0
- package/dist/lang/ast/types/document-compile-result.d.ts +8 -0
- package/dist/lang/ast/types/document-compile-result.js +25 -0
- package/dist/lang/ast/types/equality.d.ts +7 -0
- package/dist/lang/ast/types/equality.js +37 -0
- package/dist/lang/ast/types/executor.d.ts +9 -0
- package/dist/lang/ast/types/executor.js +25 -0
- package/dist/lang/ast/types/explore-desc.d.ts +5 -0
- package/dist/lang/ast/types/explore-desc.js +33 -0
- package/dist/lang/ast/types/explore-field.d.ts +5 -0
- package/dist/lang/ast/types/explore-field.js +32 -0
- package/dist/lang/ast/types/explore-property.d.ts +10 -0
- package/dist/lang/ast/types/explore-property.js +43 -0
- package/dist/lang/ast/types/expr-result.d.ts +5 -0
- package/dist/lang/ast/types/expr-result.js +25 -0
- package/dist/lang/ast/types/expr-value.d.ts +3 -0
- package/dist/lang/ast/types/expr-value.js +25 -0
- package/dist/lang/ast/types/expression-def.d.ts +69 -0
- package/dist/lang/ast/types/expression-def.js +346 -0
- package/dist/lang/ast/types/expression-value-type.d.ts +2 -0
- package/dist/lang/ast/types/expression-value-type.js +25 -0
- package/dist/lang/ast/types/field-collection-member.d.ts +5 -0
- package/dist/lang/ast/types/field-collection-member.js +34 -0
- package/dist/lang/ast/types/field-decl.d.ts +7 -0
- package/dist/lang/ast/types/field-decl.js +37 -0
- package/dist/lang/ast/types/field-map.d.ts +2 -0
- package/dist/lang/ast/types/field-map.js +25 -0
- package/dist/lang/ast/types/field-space.d.ts +26 -0
- package/dist/lang/ast/types/field-space.js +48 -0
- package/dist/lang/ast/types/field-type.d.ts +6 -0
- package/dist/lang/ast/types/field-type.js +25 -0
- package/dist/lang/ast/types/field-value-type.d.ts +3 -0
- package/dist/lang/ast/types/field-value-type.js +25 -0
- package/dist/lang/ast/types/frag-type.d.ts +6 -0
- package/dist/lang/ast/types/frag-type.js +25 -0
- package/dist/lang/ast/types/granular-result.d.ts +7 -0
- package/dist/lang/ast/types/granular-result.js +11 -0
- package/dist/lang/ast/types/lookup-result.d.ts +10 -0
- package/dist/lang/ast/types/lookup-result.js +25 -0
- package/dist/lang/ast/types/malloy-element.d.ts +105 -0
- package/dist/lang/ast/types/malloy-element.js +398 -0
- package/dist/lang/ast/types/model-entry.d.ts +6 -0
- package/dist/lang/ast/types/model-entry.js +25 -0
- package/dist/lang/ast/types/name-space.d.ts +5 -0
- package/dist/lang/ast/types/name-space.js +25 -0
- package/dist/lang/ast/types/nested-query.d.ts +3 -0
- package/dist/lang/ast/types/nested-query.js +25 -0
- package/dist/lang/ast/types/op-desc.d.ts +6 -0
- package/dist/lang/ast/types/op-desc.js +25 -0
- package/dist/lang/ast/types/query-comp.d.ts +5 -0
- package/dist/lang/ast/types/query-comp.js +25 -0
- package/dist/lang/ast/types/query-element.d.ts +5 -0
- package/dist/lang/ast/types/query-element.js +32 -0
- package/dist/lang/ast/types/query-item.d.ts +5 -0
- package/dist/lang/ast/types/query-item.js +25 -0
- package/dist/lang/ast/types/query-property.d.ts +17 -0
- package/dist/lang/ast/types/query-property.js +55 -0
- package/dist/lang/ast/types/space-entry.d.ts +5 -0
- package/dist/lang/ast/types/space-entry.js +29 -0
- package/dist/lang/ast/types/space-field.d.ts +10 -0
- package/dist/lang/ast/types/space-field.js +48 -0
- package/dist/lang/ast/types/space-param.d.ts +6 -0
- package/dist/lang/ast/types/space-param.js +34 -0
- package/dist/lang/ast/types/stage-field-type.d.ts +1 -0
- package/dist/lang/ast/types/stage-field-type.js +25 -0
- package/dist/lang/ast/types/time-result.d.ts +6 -0
- package/dist/lang/ast/types/time-result.js +25 -0
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +7 -0
- package/dist/lang/ast/types/turtle-headed-pipe.js +37 -0
- package/dist/lang/space-field.d.ts +4 -1
- package/dist/lang/space-field.js +4 -3
- package/dist/lang/test/field-symbols.spec.js +25 -21
- package/dist/lang/test/parse.spec.js +4 -3
- package/dist/lang/test/test-translator.d.ts +3 -1
- package/package.json +1 -1
- package/dist/lang/ast/apply-expr.d.ts +0 -3
- package/dist/lang/ast/ast-expr.d.ts +0 -206
- package/dist/lang/ast/ast-expr.js +0 -781
- package/dist/lang/ast/ast-time-expr.d.ts +0 -69
- package/dist/lang/ast/ast-time-expr.js +0 -389
- package/dist/lang/ast/ast-types.d.ts +0 -83
- package/dist/lang/ast/ast-types.js +0 -225
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GranularResult
|
|
1
|
+
import { AtomicFieldType, Expr, Fragment, TimeFieldType, TimestampUnit } from "../../model/malloy_types";
|
|
2
|
+
import { GranularResult } from "./types/granular-result";
|
|
3
|
+
import { TimeResult } from "./types/time-result";
|
|
3
4
|
export declare function timeOffset(timeType: TimeFieldType, from: Expr, op: "+" | "-", n: Expr, timeframe: TimestampUnit): Expr;
|
|
4
5
|
export declare function castTo(castType: AtomicFieldType, from: Expr, safe?: boolean): Expr;
|
|
5
6
|
export declare function castTimestampToDate(from: Expr, safe?: boolean): Expr;
|
|
@@ -7,3 +8,5 @@ export declare function castDateToTimestamp(from: Expr, safe?: boolean): Expr;
|
|
|
7
8
|
export declare function resolution(timeframe: string): TimeFieldType;
|
|
8
9
|
export declare function timeResult(t: TimeResult, tt: TimestampUnit | undefined): TimeResult | GranularResult;
|
|
9
10
|
export declare function timeLiteral(literalStr: string, timeType: TimeFieldType, tz: string): Expr;
|
|
11
|
+
export declare function timestampOffset(from: Fragment[], op: "+" | "-", n: Fragment[], timeframe: TimestampUnit, fromNotTimestamp?: boolean): Fragment[];
|
|
12
|
+
export declare function dateOffset(from: Fragment[], op: "+" | "-", n: Fragment[], timeframe: TimestampUnit): Fragment[];
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.timeLiteral = exports.timeResult = exports.resolution = exports.castDateToTimestamp = exports.castTimestampToDate = exports.castTo = exports.timeOffset = void 0;
|
|
25
|
+
exports.dateOffset = exports.timestampOffset = exports.timeLiteral = exports.timeResult = exports.resolution = exports.castDateToTimestamp = exports.castTimestampToDate = exports.castTo = exports.timeOffset = void 0;
|
|
26
|
+
const utils_1 = require("./expressions/utils");
|
|
26
27
|
function timeOffset(timeType, from, op, n, timeframe) {
|
|
27
28
|
return [
|
|
28
29
|
{
|
|
@@ -101,4 +102,39 @@ function timeLiteral(literalStr, timeType, tz) {
|
|
|
101
102
|
return [fragment];
|
|
102
103
|
}
|
|
103
104
|
exports.timeLiteral = timeLiteral;
|
|
105
|
+
function timestampOffset(from, op, n, timeframe, fromNotTimestamp = false) {
|
|
106
|
+
const useDatetime = ["week", "month", "quarter", "year"].includes(timeframe);
|
|
107
|
+
const add = op === "+" ? "_ADD" : "_SUB";
|
|
108
|
+
const units = timeframe.toUpperCase();
|
|
109
|
+
if (useDatetime) {
|
|
110
|
+
return [
|
|
111
|
+
`TIMESTAMP(DATETIME${add}(DATETIME(`,
|
|
112
|
+
...from,
|
|
113
|
+
`),INTERVAL `,
|
|
114
|
+
...n,
|
|
115
|
+
` ${units}))`,
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
const typeFrom = fromNotTimestamp ? ["TIMESTAMP(", ...from, ")"] : from;
|
|
119
|
+
return (0, utils_1.compressExpr)([
|
|
120
|
+
`TIMESTAMP${add}(`,
|
|
121
|
+
...typeFrom,
|
|
122
|
+
`,INTERVAL `,
|
|
123
|
+
...n,
|
|
124
|
+
` ${units})`,
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
exports.timestampOffset = timestampOffset;
|
|
128
|
+
function dateOffset(from, op, n, timeframe) {
|
|
129
|
+
const add = op === "+" ? "_ADD" : "_SUB";
|
|
130
|
+
const units = timeframe.toUpperCase();
|
|
131
|
+
return (0, utils_1.compressExpr)([
|
|
132
|
+
`DATE${add}(`,
|
|
133
|
+
...from,
|
|
134
|
+
`,INTERVAL `,
|
|
135
|
+
...n,
|
|
136
|
+
` ${units})`,
|
|
137
|
+
]);
|
|
138
|
+
}
|
|
139
|
+
exports.dateOffset = dateOffset;
|
|
104
140
|
//# sourceMappingURL=time-utils.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum Comparison {
|
|
2
|
+
Like = "~",
|
|
3
|
+
NotLike = "!~",
|
|
4
|
+
LessThan = "<",
|
|
5
|
+
LessThanOrEqualTo = "<=",
|
|
6
|
+
EqualTo = "=",
|
|
7
|
+
GreaterThan = ">",
|
|
8
|
+
GreaterThanOrEqualTo = ">=",
|
|
9
|
+
NotEqualTo = "!="
|
|
10
|
+
}
|
|
11
|
+
export declare function isComparison(s: string): s is Comparison;
|
|
@@ -0,0 +1,41 @@
|
|
|
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.isComparison = exports.Comparison = void 0;
|
|
26
|
+
var Comparison;
|
|
27
|
+
(function (Comparison) {
|
|
28
|
+
Comparison["Like"] = "~";
|
|
29
|
+
Comparison["NotLike"] = "!~";
|
|
30
|
+
Comparison["LessThan"] = "<";
|
|
31
|
+
Comparison["LessThanOrEqualTo"] = "<=";
|
|
32
|
+
Comparison["EqualTo"] = "=";
|
|
33
|
+
Comparison["GreaterThan"] = ">";
|
|
34
|
+
Comparison["GreaterThanOrEqualTo"] = ">=";
|
|
35
|
+
Comparison["NotEqualTo"] = "!=";
|
|
36
|
+
})(Comparison = exports.Comparison || (exports.Comparison = {}));
|
|
37
|
+
function isComparison(s) {
|
|
38
|
+
return Object.values(Comparison).includes(s);
|
|
39
|
+
}
|
|
40
|
+
exports.isComparison = isComparison;
|
|
41
|
+
//# sourceMappingURL=comparison.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const compareTypes: {
|
|
2
|
+
"~": import("./frag-type").FragType[];
|
|
3
|
+
"!~": import("./frag-type").FragType[];
|
|
4
|
+
"<": import("./frag-type").FragType[];
|
|
5
|
+
"<=": import("./frag-type").FragType[];
|
|
6
|
+
"=": import("./frag-type").FragType[];
|
|
7
|
+
"!=": import("./frag-type").FragType[];
|
|
8
|
+
">=": import("./frag-type").FragType[];
|
|
9
|
+
">": import("./frag-type").FragType[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
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.compareTypes = void 0;
|
|
26
|
+
const fragtype_utils_1 = require("../fragtype-utils");
|
|
27
|
+
exports.compareTypes = {
|
|
28
|
+
"~": [fragtype_utils_1.FT.stringT],
|
|
29
|
+
"!~": [fragtype_utils_1.FT.stringT],
|
|
30
|
+
"<": [fragtype_utils_1.FT.numberT, fragtype_utils_1.FT.stringT, fragtype_utils_1.FT.dateT, fragtype_utils_1.FT.timestampT],
|
|
31
|
+
"<=": [fragtype_utils_1.FT.numberT, fragtype_utils_1.FT.stringT, fragtype_utils_1.FT.dateT, fragtype_utils_1.FT.timestampT],
|
|
32
|
+
"=": [fragtype_utils_1.FT.numberT, fragtype_utils_1.FT.stringT, fragtype_utils_1.FT.dateT, fragtype_utils_1.FT.timestampT],
|
|
33
|
+
"!=": [fragtype_utils_1.FT.numberT, fragtype_utils_1.FT.stringT, fragtype_utils_1.FT.dateT, fragtype_utils_1.FT.timestampT],
|
|
34
|
+
">=": [fragtype_utils_1.FT.numberT, fragtype_utils_1.FT.stringT, fragtype_utils_1.FT.dateT, fragtype_utils_1.FT.timestampT],
|
|
35
|
+
">": [fragtype_utils_1.FT.numberT, fragtype_utils_1.FT.stringT, fragtype_utils_1.FT.dateT, fragtype_utils_1.FT.timestampT],
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=compart-types.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModelDef, Query, SQLBlockStructDef } from "../../../model/malloy_types";
|
|
2
|
+
import { ModelDataRequest } from "../../parse-malloy";
|
|
3
|
+
export interface DocumentCompileResult {
|
|
4
|
+
modelDef: ModelDef;
|
|
5
|
+
queryList: Query[];
|
|
6
|
+
sqlBlocks: SQLBlockStructDef[];
|
|
7
|
+
needs: ModelDataRequest;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
//# sourceMappingURL=document-compile-result.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
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.isEquality = exports.Equality = void 0;
|
|
26
|
+
var Equality;
|
|
27
|
+
(function (Equality) {
|
|
28
|
+
Equality["Like"] = "~";
|
|
29
|
+
Equality["NotLike"] = "!~";
|
|
30
|
+
Equality["Equals"] = "=";
|
|
31
|
+
Equality["NotEquals"] = "!=";
|
|
32
|
+
})(Equality = exports.Equality || (exports.Equality = {}));
|
|
33
|
+
function isEquality(s) {
|
|
34
|
+
return Object.values(Equality).includes(s);
|
|
35
|
+
}
|
|
36
|
+
exports.isEquality = isEquality;
|
|
37
|
+
//# sourceMappingURL=equality.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PipeSegment } from "../../../model/malloy_types";
|
|
2
|
+
import { QueryProperty } from "./query-property";
|
|
3
|
+
import { QuerySpace, ResultSpace } from "../ast-main";
|
|
4
|
+
export interface Executor {
|
|
5
|
+
inputFS: QuerySpace;
|
|
6
|
+
resultFS: ResultSpace;
|
|
7
|
+
execute(qp: QueryProperty): void;
|
|
8
|
+
finalize(refineFrom: PipeSegment | undefined): PipeSegment;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
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.ExploreDesc = void 0;
|
|
26
|
+
const malloy_element_1 = require("./malloy-element");
|
|
27
|
+
class ExploreDesc extends malloy_element_1.ListOf {
|
|
28
|
+
constructor(props) {
|
|
29
|
+
super("exploreDesc", props);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ExploreDesc = ExploreDesc;
|
|
33
|
+
//# sourceMappingURL=explore-desc.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RenameField } from "../explore-properties/renames";
|
|
2
|
+
import { FieldDecl } from "./field-decl";
|
|
3
|
+
import { MalloyElement } from "./malloy-element";
|
|
4
|
+
export declare type ExploreField = FieldDecl | RenameField;
|
|
5
|
+
export declare function isExploreField(f: MalloyElement): f is ExploreField;
|
|
@@ -0,0 +1,32 @@
|
|
|
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.isExploreField = void 0;
|
|
26
|
+
const renames_1 = require("../explore-properties/renames");
|
|
27
|
+
const field_decl_1 = require("./field-decl");
|
|
28
|
+
function isExploreField(f) {
|
|
29
|
+
return (0, field_decl_1.isFieldDecl)(f) || f instanceof renames_1.RenameField;
|
|
30
|
+
}
|
|
31
|
+
exports.isExploreField = isExploreField;
|
|
32
|
+
//# sourceMappingURL=explore-field.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Filter } from "../query-properties/filters";
|
|
2
|
+
import { Joins } from "../query-properties/joins";
|
|
3
|
+
import { DeclareFields } from "../query-properties/declare-fields";
|
|
4
|
+
import { FieldListEdit } from "../explore-properties/field-list-edit";
|
|
5
|
+
import { Renames } from "../explore-properties/renames";
|
|
6
|
+
import { PrimaryKey } from "../explore-properties/primary-key";
|
|
7
|
+
import { Turtles } from "../explore-properties/turtles";
|
|
8
|
+
import { MalloyElement } from "./malloy-element";
|
|
9
|
+
export declare type ExploreProperty = Filter | Joins | DeclareFields | FieldListEdit | Renames | PrimaryKey | Turtles;
|
|
10
|
+
export declare function isExploreProperty(p: MalloyElement): p is ExploreProperty;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.isExploreProperty = void 0;
|
|
26
|
+
const filters_1 = require("../query-properties/filters");
|
|
27
|
+
const joins_1 = require("../query-properties/joins");
|
|
28
|
+
const declare_fields_1 = require("../query-properties/declare-fields");
|
|
29
|
+
const field_list_edit_1 = require("../explore-properties/field-list-edit");
|
|
30
|
+
const renames_1 = require("../explore-properties/renames");
|
|
31
|
+
const primary_key_1 = require("../explore-properties/primary-key");
|
|
32
|
+
const turtles_1 = require("../explore-properties/turtles");
|
|
33
|
+
function isExploreProperty(p) {
|
|
34
|
+
return (p instanceof filters_1.Filter ||
|
|
35
|
+
p instanceof joins_1.Joins ||
|
|
36
|
+
p instanceof declare_fields_1.DeclareFields ||
|
|
37
|
+
p instanceof field_list_edit_1.FieldListEdit ||
|
|
38
|
+
p instanceof renames_1.Renames ||
|
|
39
|
+
p instanceof primary_key_1.PrimaryKey ||
|
|
40
|
+
p instanceof turtles_1.Turtles);
|
|
41
|
+
}
|
|
42
|
+
exports.isExploreProperty = isExploreProperty;
|
|
43
|
+
//# sourceMappingURL=explore-property.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
//# sourceMappingURL=expr-result.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
//# sourceMappingURL=expr-value.js.map
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* Root node for any element in an expression. These essentially
|
|
7
|
+
* create a sub-tree in the larger AST. Expression nodes know
|
|
8
|
+
* how to write themselves as SQL (or rather, generate the
|
|
9
|
+
* template for SQL required by the query writer)
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class ExpressionDef extends MalloyElement {
|
|
12
|
+
abstract elementType: string;
|
|
13
|
+
granular(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the "translation" or template for SQL generation. When asking
|
|
16
|
+
* for a tranlsation you may pass the types you can accept, allowing
|
|
17
|
+
* the translation code a chance to convert to match your expectations
|
|
18
|
+
* @param space Namespace for looking up field references
|
|
19
|
+
*/
|
|
20
|
+
abstract getExpression(fs: FieldSpace): ExprValue;
|
|
21
|
+
legalChildTypes: import("./frag-type").FragType[];
|
|
22
|
+
/**
|
|
23
|
+
* Some operators want to give the right hand value a chance to
|
|
24
|
+
* rewrite itself. This requests a translation for a rewrite,
|
|
25
|
+
* or returns undefined if that request should be denied.
|
|
26
|
+
* @param fs FieldSpace
|
|
27
|
+
* @returns Translated expression or undefined
|
|
28
|
+
*/
|
|
29
|
+
requestExpression(fs: FieldSpace): ExprValue | undefined;
|
|
30
|
+
defaultFieldName(): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Check an expression for type compatibility
|
|
33
|
+
* @param _eNode currently unused, will be used to get error location
|
|
34
|
+
* @param eVal ...list of expressions that must match legalChildTypes
|
|
35
|
+
*/
|
|
36
|
+
typeCheck(eNode: ExpressionDef, eVal: ExprValue): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* This is the operation which makes partial comparison and value trees work
|
|
39
|
+
* The default implemention merely constructs LEFT OP RIGHT, but specialized
|
|
40
|
+
* nodes like alternation trees or or partial comparison can control how
|
|
41
|
+
* the appplication gets generated
|
|
42
|
+
* @param fs The symbol table
|
|
43
|
+
* @param op The operator being applied
|
|
44
|
+
* @param expr The "other" (besdies 'this') value
|
|
45
|
+
* @returns The translated expression
|
|
46
|
+
*/
|
|
47
|
+
apply(fs: FieldSpace, op: string, left: ExpressionDef): ExprValue;
|
|
48
|
+
}
|
|
49
|
+
export declare class ExprDuration extends ExpressionDef {
|
|
50
|
+
readonly n: ExpressionDef;
|
|
51
|
+
readonly timeframe: TimestampUnit;
|
|
52
|
+
elementType: string;
|
|
53
|
+
legalChildTypes: import("./frag-type").FragType[];
|
|
54
|
+
constructor(n: ExpressionDef, timeframe: TimestampUnit);
|
|
55
|
+
apply(fs: FieldSpace, op: string, left: ExpressionDef): ExprValue;
|
|
56
|
+
getExpression(_fs: FieldSpace): ExprValue;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* All of the magic of malloy expressions eventually flows to here,
|
|
60
|
+
* where an operator is applied to two values. Depending on the
|
|
61
|
+
* operator and value types this may involve transformations of
|
|
62
|
+
* the values or even the operator.
|
|
63
|
+
* @param fs FieldSpace for the symbols
|
|
64
|
+
* @param left Left value
|
|
65
|
+
* @param op The operator
|
|
66
|
+
* @param right Right Value
|
|
67
|
+
* @returns ExprValue of the expression
|
|
68
|
+
*/
|
|
69
|
+
export declare function applyBinary(fs: FieldSpace, left: ExpressionDef, op: string, right: ExpressionDef): ExprValue;
|