@malloydata/malloy 0.0.22-dev230207182613 → 0.0.22-dev230207183024
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection_utils.js +7 -7
- package/dist/dialect/dialect.d.ts +1 -1
- package/dist/dialect/duckdb.d.ts +1 -1
- package/dist/dialect/duckdb.js +9 -9
- package/dist/dialect/postgres.d.ts +1 -1
- package/dist/dialect/postgres.js +16 -16
- package/dist/dialect/standardsql.d.ts +1 -1
- package/dist/dialect/standardsql.js +8 -8
- package/dist/index.d.ts +6 -6
- package/dist/lang/ast/ast-utils.js +3 -3
- package/dist/lang/ast/elements/define-query.js +4 -4
- package/dist/lang/ast/elements/define-source.d.ts +1 -1
- package/dist/lang/ast/elements/define-source.js +8 -8
- package/dist/lang/ast/elements/import-statement.js +2 -2
- package/dist/lang/ast/elements/pipeline-desc.d.ts +1 -1
- package/dist/lang/ast/elements/pipeline-desc.js +7 -7
- package/dist/lang/ast/elements/refined-source.d.ts +1 -1
- package/dist/lang/ast/elements/refined-source.js +5 -5
- package/dist/lang/ast/elements/source.js +1 -1
- package/dist/lang/ast/error-factory.js +16 -13
- package/dist/lang/ast/expressions/binary-boolean.d.ts +1 -1
- package/dist/lang/ast/expressions/binary-boolean.js +4 -4
- package/dist/lang/ast/expressions/binary-numeric.d.ts +1 -1
- package/dist/lang/ast/expressions/binary-numeric.js +1 -1
- package/dist/lang/ast/expressions/boolean.js +1 -1
- package/dist/lang/ast/expressions/constant-sub-expression.js +7 -7
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-aggregate-function.js +12 -12
- package/dist/lang/ast/expressions/expr-alternation-tree.js +3 -3
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-asymmetric.js +1 -1
- package/dist/lang/ast/expressions/expr-avg.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-avg.js +1 -1
- package/dist/lang/ast/expressions/expr-cast.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-cast.js +26 -4
- package/dist/lang/ast/expressions/expr-compare.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-compare.js +3 -3
- package/dist/lang/ast/expressions/expr-count.js +6 -6
- package/dist/lang/ast/expressions/expr-filter.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-filter.js +8 -8
- package/dist/lang/ast/expressions/expr-func.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-func.js +3 -3
- package/dist/lang/ast/expressions/expr-granular-time.js +7 -7
- package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
- package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
- package/dist/lang/ast/expressions/expr-minus.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-minus.js +3 -3
- package/dist/lang/ast/expressions/expr-not.js +2 -2
- package/dist/lang/ast/expressions/expr-now.js +7 -7
- package/dist/lang/ast/expressions/expr-null.js +3 -3
- package/dist/lang/ast/expressions/expr-number.js +1 -1
- package/dist/lang/ast/expressions/expr-parens.js +2 -2
- package/dist/lang/ast/expressions/expr-regex.js +3 -3
- package/dist/lang/ast/expressions/expr-string.js +6 -6
- package/dist/lang/ast/expressions/expr-sum.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-sum.js +1 -1
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +1 -1
- package/dist/lang/ast/expressions/expr-time-extract.js +29 -29
- package/dist/lang/ast/expressions/expr-time.js +7 -7
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-ungroup.js +11 -8
- package/dist/lang/ast/expressions/for-range.d.ts +1 -1
- package/dist/lang/ast/expressions/for-range.js +1 -1
- package/dist/lang/ast/expressions/granular-literal.js +12 -12
- package/dist/lang/ast/expressions/partial-compare.d.ts +1 -1
- package/dist/lang/ast/expressions/partial-compare.js +1 -1
- package/dist/lang/ast/expressions/pick-when.d.ts +1 -1
- package/dist/lang/ast/expressions/pick-when.js +11 -11
- package/dist/lang/ast/expressions/range.js +4 -4
- package/dist/lang/ast/expressions/top-by.d.ts +1 -1
- package/dist/lang/ast/expressions/top-by.js +4 -4
- package/dist/lang/ast/expressions/unary.js +1 -1
- package/dist/lang/ast/field-space/dynamic-space.d.ts +1 -1
- package/dist/lang/ast/field-space/dynamic-space.js +1 -1
- package/dist/lang/ast/field-space/index-field-space.js +2 -2
- package/dist/lang/ast/field-space/query-field-struct.js +1 -1
- package/dist/lang/ast/field-space/query-space-field.js +1 -1
- package/dist/lang/ast/field-space/query-spaces.js +2 -2
- package/dist/lang/ast/field-space/reference-field.js +1 -1
- package/dist/lang/ast/field-space/rename-space-field.js +2 -2
- package/dist/lang/ast/field-space/static-space.js +8 -8
- package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
- package/dist/lang/ast/fragtype-utils.js +2 -2
- package/dist/lang/ast/parameters/constant-parameter.js +9 -9
- package/dist/lang/ast/parameters/has-parameter.js +5 -5
- package/dist/lang/ast/query-elements/anonymous-query.js +1 -1
- package/dist/lang/ast/query-elements/existing-query.d.ts +1 -1
- package/dist/lang/ast/query-elements/existing-query.js +11 -11
- package/dist/lang/ast/query-elements/full-query.js +11 -11
- package/dist/lang/ast/query-elements/query-head-struct.js +1 -1
- package/dist/lang/ast/query-items/field-declaration.d.ts +1 -1
- package/dist/lang/ast/query-items/field-declaration.js +11 -11
- package/dist/lang/ast/query-items/field-references.d.ts +1 -1
- package/dist/lang/ast/query-items/field-references.js +1 -1
- package/dist/lang/ast/query-properties/filters.d.ts +1 -1
- package/dist/lang/ast/query-properties/filters.js +7 -7
- package/dist/lang/ast/query-properties/indexing.d.ts +1 -1
- package/dist/lang/ast/query-properties/indexing.js +2 -2
- package/dist/lang/ast/query-properties/joins.d.ts +1 -1
- package/dist/lang/ast/query-properties/joins.js +17 -14
- package/dist/lang/ast/query-properties/nest.js +4 -4
- package/dist/lang/ast/query-properties/ordering.js +2 -2
- package/dist/lang/ast/query-properties/qop-desc.js +1 -1
- package/dist/lang/ast/query-properties/top.js +3 -3
- package/dist/lang/ast/source-properties/field-list-edit.js +1 -1
- package/dist/lang/ast/source-properties/primary-key.js +1 -1
- package/dist/lang/ast/source-properties/renames.js +1 -1
- package/dist/lang/ast/sources/named-source.d.ts +2 -2
- package/dist/lang/ast/sources/named-source.js +6 -6
- package/dist/lang/ast/sources/query-source.d.ts +1 -1
- package/dist/lang/ast/sources/query-source.js +2 -2
- package/dist/lang/ast/sources/table-source.js +7 -5
- package/dist/lang/ast/space-seed.d.ts +1 -1
- package/dist/lang/ast/sql-elements/sql-statement.js +5 -5
- package/dist/lang/ast/sql-elements/sql-string.js +1 -1
- package/dist/lang/ast/struct-utils.js +2 -2
- package/dist/lang/ast/time-utils.js +32 -32
- package/dist/lang/ast/types/expression-def.js +34 -34
- package/dist/lang/ast/types/malloy-element.d.ts +4 -4
- package/dist/lang/ast/types/malloy-element.js +27 -27
- package/dist/lang/ast/types/query-comp.d.ts +1 -1
- package/dist/lang/ast/types/space-field.js +1 -1
- package/dist/lang/ast/types/space-param.js +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +1 -1
- package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
- package/dist/lang/ast/types/type-desc.d.ts +1 -1
- package/dist/lang/field-utils.d.ts +1 -1
- package/dist/lang/index.d.ts +1 -1
- package/dist/lang/malloy-to-ast.d.ts +1 -1
- package/dist/lang/malloy-to-ast.js +11 -11
- package/dist/lang/parse-error-handler.js +4 -4
- package/dist/lang/parse-malloy.d.ts +4 -4
- package/dist/lang/parse-malloy.js +61 -61
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +16 -16
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +10 -10
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -82
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +1 -1
- 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 +6 -6
- package/dist/lang/test/document-symbol-walker.spec.js +3 -3
- package/dist/lang/test/field-symbols.spec.js +62 -58
- package/dist/lang/test/parse.spec.js +262 -260
- package/dist/lang/test/test-translator.d.ts +1 -1
- package/dist/lang/test/test-translator.js +139 -139
- package/dist/lang/translate-response.d.ts +1 -1
- package/dist/lang/zone.js +5 -5
- package/dist/malloy.d.ts +5 -5
- package/dist/malloy.js +72 -72
- package/dist/model/malloy_query.d.ts +2 -2
- package/dist/model/malloy_query.js +179 -176
- package/dist/model/malloy_types.js +41 -41
- package/dist/model/sql_block.js +2 -2
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ class HasParameter extends malloy_element_1.MalloyElement {
|
|
|
36
36
|
}
|
|
37
37
|
if (init.default) {
|
|
38
38
|
this.default = init.default;
|
|
39
|
-
this.has({ default: this.default });
|
|
39
|
+
this.has({ "default": this.default });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
parameter() {
|
|
@@ -48,15 +48,15 @@ class HasParameter extends malloy_element_1.MalloyElement {
|
|
|
48
48
|
return {
|
|
49
49
|
type,
|
|
50
50
|
name,
|
|
51
|
-
condition: cCond
|
|
51
|
+
"condition": cCond
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
const cVal = ((_b = this.default) === null || _b === void 0 ? void 0 : _b.constantValue().value) || null;
|
|
55
55
|
return {
|
|
56
|
-
value: cVal,
|
|
56
|
+
"value": cVal,
|
|
57
57
|
type,
|
|
58
|
-
name: this.name,
|
|
59
|
-
constant: false
|
|
58
|
+
"name": this.name,
|
|
59
|
+
"constant": false
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -29,7 +29,7 @@ class AnonymousQuery extends malloy_element_1.MalloyElement {
|
|
|
29
29
|
super();
|
|
30
30
|
this.theQuery = theQuery;
|
|
31
31
|
this.elementType = "anonymousQuery";
|
|
32
|
-
this.has({ query: theQuery });
|
|
32
|
+
this.has({ "query": theQuery });
|
|
33
33
|
}
|
|
34
34
|
execute(doc) {
|
|
35
35
|
const modelQuery = this.theQuery.query();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query } from "../../../model/malloy_types";
|
|
2
|
-
import { ModelEntryReference } from "../types/malloy-element";
|
|
3
2
|
import { PipelineDesc } from "../elements/pipeline-desc";
|
|
3
|
+
import { ModelEntryReference } from "../types/malloy-element";
|
|
4
4
|
import { QueryComp } from "../types/query-comp";
|
|
5
5
|
export declare class ExistingQuery extends PipelineDesc {
|
|
6
6
|
_head?: ModelEntryReference;
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.ExistingQuery = void 0;
|
|
26
|
-
const error_factory_1 = require("../error-factory");
|
|
27
26
|
const pipeline_desc_1 = require("../elements/pipeline-desc");
|
|
28
|
-
const
|
|
27
|
+
const error_factory_1 = require("../error-factory");
|
|
29
28
|
const static_space_1 = require("../field-space/static-space");
|
|
29
|
+
const query_head_struct_1 = require("./query-head-struct");
|
|
30
30
|
class ExistingQuery extends pipeline_desc_1.PipelineDesc {
|
|
31
31
|
set head(head) {
|
|
32
32
|
this._head = head;
|
|
33
|
-
this.has({ head });
|
|
33
|
+
this.has({ "head": head });
|
|
34
34
|
}
|
|
35
35
|
get head() {
|
|
36
36
|
return this._head;
|
|
@@ -43,8 +43,8 @@ class ExistingQuery extends pipeline_desc_1.PipelineDesc {
|
|
|
43
43
|
const seedQuery = queryEntry === null || queryEntry === void 0 ? void 0 : queryEntry.entry;
|
|
44
44
|
const oops = function () {
|
|
45
45
|
return {
|
|
46
|
-
outputStruct: error_factory_1.ErrorFactory.structDef,
|
|
47
|
-
query: error_factory_1.ErrorFactory.query
|
|
46
|
+
"outputStruct": error_factory_1.ErrorFactory.structDef,
|
|
47
|
+
"query": error_factory_1.ErrorFactory.query
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
if (!seedQuery) {
|
|
@@ -56,20 +56,20 @@ class ExistingQuery extends pipeline_desc_1.PipelineDesc {
|
|
|
56
56
|
return oops();
|
|
57
57
|
}
|
|
58
58
|
const queryHead = new query_head_struct_1.QueryHeadStruct(seedQuery.structRef);
|
|
59
|
-
this.has({ queryHead });
|
|
59
|
+
this.has({ "queryHead": queryHead });
|
|
60
60
|
const exploreStruct = queryHead.structDef();
|
|
61
61
|
const exploreFS = new static_space_1.StaticSpace(exploreStruct);
|
|
62
62
|
const sourcePipe = this.refinePipeline(exploreFS, seedQuery);
|
|
63
63
|
const walkStruct = this.getOutputStruct(exploreStruct, sourcePipe.pipeline);
|
|
64
64
|
const appended = this.appendOps(sourcePipe.pipeline, new static_space_1.StaticSpace(walkStruct));
|
|
65
|
-
const destPipe = { ...sourcePipe, pipeline: appended.opList };
|
|
65
|
+
const destPipe = { ...sourcePipe, "pipeline": appended.opList };
|
|
66
66
|
const query = {
|
|
67
|
-
type: "query",
|
|
67
|
+
"type": "query",
|
|
68
68
|
...destPipe,
|
|
69
|
-
structRef: queryHead.structRef(),
|
|
70
|
-
location: this.location
|
|
69
|
+
"structRef": queryHead.structRef(),
|
|
70
|
+
"location": this.location
|
|
71
71
|
};
|
|
72
|
-
return { outputStruct: appended.structDef, query };
|
|
72
|
+
return { "outputStruct": appended.structDef, query };
|
|
73
73
|
}
|
|
74
74
|
query() {
|
|
75
75
|
return this.queryComp().query;
|
|
@@ -25,20 +25,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.FullQuery = void 0;
|
|
26
26
|
const malloy_types_1 = require("../../../model/malloy_types");
|
|
27
27
|
const error_factory_1 = require("../error-factory");
|
|
28
|
-
const turtle_headed_pipe_1 = require("../types/turtle-headed-pipe");
|
|
29
28
|
const static_space_1 = require("../field-space/static-space");
|
|
29
|
+
const turtle_headed_pipe_1 = require("../types/turtle-headed-pipe");
|
|
30
30
|
class FullQuery extends turtle_headed_pipe_1.TurtleHeadedPipe {
|
|
31
31
|
constructor(explore) {
|
|
32
|
-
super({ explore });
|
|
32
|
+
super({ "explore": explore });
|
|
33
33
|
this.explore = explore;
|
|
34
34
|
}
|
|
35
35
|
queryComp() {
|
|
36
36
|
const structRef = this.explore.structRef();
|
|
37
37
|
const destQuery = {
|
|
38
|
-
type: "query",
|
|
38
|
+
"type": "query",
|
|
39
39
|
structRef,
|
|
40
|
-
pipeline: [],
|
|
41
|
-
location: this.location
|
|
40
|
+
"pipeline": [],
|
|
41
|
+
"location": this.location
|
|
42
42
|
};
|
|
43
43
|
const structDef = (0, malloy_types_1.refIsStructDef)(structRef)
|
|
44
44
|
? structRef
|
|
@@ -46,11 +46,11 @@ class FullQuery extends turtle_headed_pipe_1.TurtleHeadedPipe {
|
|
|
46
46
|
let pipeFs = new static_space_1.StaticSpace(structDef);
|
|
47
47
|
if (error_factory_1.ErrorFactory.isErrorStructDef(structDef)) {
|
|
48
48
|
return {
|
|
49
|
-
outputStruct: structDef,
|
|
50
|
-
query: {
|
|
51
|
-
structRef: structRef,
|
|
52
|
-
pipeline: []
|
|
53
|
-
}
|
|
49
|
+
"outputStruct": structDef,
|
|
50
|
+
"query": {
|
|
51
|
+
"structRef": structRef,
|
|
52
|
+
"pipeline": []
|
|
53
|
+
}
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
if (this.turtleName) {
|
|
@@ -75,7 +75,7 @@ class FullQuery extends turtle_headed_pipe_1.TurtleHeadedPipe {
|
|
|
75
75
|
}
|
|
76
76
|
const appended = this.appendOps(destQuery.pipeline, pipeFs);
|
|
77
77
|
destQuery.pipeline = appended.opList;
|
|
78
|
-
return { outputStruct: appended.structDef, query: destQuery };
|
|
78
|
+
return { "outputStruct": appended.structDef, "query": destQuery };
|
|
79
79
|
}
|
|
80
80
|
query() {
|
|
81
81
|
return this.queryComp().query;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dialect } from "../../../dialect/dialect";
|
|
2
2
|
import { FieldTypeDef, StructDef } from "../../../model/malloy_types";
|
|
3
|
-
import { LookupResult } from "../types/lookup-result";
|
|
4
3
|
import { ExpressionDef } from "../types/expression-def";
|
|
5
4
|
import { FieldName, FieldSpace } from "../types/field-space";
|
|
5
|
+
import { LookupResult } from "../types/lookup-result";
|
|
6
6
|
import { MalloyElement } from "../types/malloy-element";
|
|
7
7
|
export declare class FieldDeclaration extends MalloyElement {
|
|
8
8
|
readonly expr: ExpressionDef;
|
|
@@ -26,11 +26,11 @@ exports.DefSpace = exports.FieldDeclaration = void 0;
|
|
|
26
26
|
const malloy_types_1 = require("../../../model/malloy_types");
|
|
27
27
|
const utils_1 = require("../expressions/utils");
|
|
28
28
|
const fragtype_utils_1 = require("../fragtype-utils");
|
|
29
|
-
const malloy_element_1 = require("../types/malloy-element");
|
|
30
29
|
const granular_result_1 = require("../types/granular-result");
|
|
30
|
+
const malloy_element_1 = require("../types/malloy-element");
|
|
31
31
|
class FieldDeclaration extends malloy_element_1.MalloyElement {
|
|
32
32
|
constructor(expr, defineName, exprSrc) {
|
|
33
|
-
super({ expr });
|
|
33
|
+
super({ "expr": expr });
|
|
34
34
|
this.expr = expr;
|
|
35
35
|
this.defineName = defineName;
|
|
36
36
|
this.exprSrc = exprSrc;
|
|
@@ -56,17 +56,17 @@ class FieldDeclaration extends malloy_element_1.MalloyElement {
|
|
|
56
56
|
catch (error) {
|
|
57
57
|
this.log(`Cannot define '${exprName}', ${error.message}`);
|
|
58
58
|
return {
|
|
59
|
-
name: `error_defining_${exprName}`,
|
|
60
|
-
type: "string"
|
|
59
|
+
"name": `error_defining_${exprName}`,
|
|
60
|
+
"type": "string"
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
const compressValue = (0, utils_1.compressExpr)(exprValue.value);
|
|
64
64
|
const retType = exprValue.dataType;
|
|
65
65
|
if ((0, malloy_types_1.isAtomicFieldType)(retType)) {
|
|
66
66
|
const template = {
|
|
67
|
-
name: exprName,
|
|
68
|
-
type: retType,
|
|
69
|
-
location: this.location
|
|
67
|
+
"name": exprName,
|
|
68
|
+
"type": retType,
|
|
69
|
+
"location": this.location
|
|
70
70
|
};
|
|
71
71
|
if (compressValue.length > 0) {
|
|
72
72
|
template.e = compressValue;
|
|
@@ -94,8 +94,8 @@ class FieldDeclaration extends malloy_element_1.MalloyElement {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
return {
|
|
97
|
-
name: `error_defining_${exprName}`,
|
|
98
|
-
type: "string"
|
|
97
|
+
"name": `error_defining_${exprName}`,
|
|
98
|
+
"type": "string"
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -120,8 +120,8 @@ class DefSpace {
|
|
|
120
120
|
if (symbol[0] && symbol[0].refString === this.circular.defineName) {
|
|
121
121
|
this.foundCircle = true;
|
|
122
122
|
return {
|
|
123
|
-
error: `Circular reference to '${this.circular.defineName}' in definition`,
|
|
124
|
-
found: undefined
|
|
123
|
+
"error": `Circular reference to '${this.circular.defineName}' in definition`,
|
|
124
|
+
"found": undefined
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
return this.realFS.lookup(symbol);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FieldDef } from "../../../model/malloy_types";
|
|
2
2
|
import { FieldName, FieldSpace } from "../types/field-space";
|
|
3
|
-
import { ListOf, MalloyElement } from "../types/malloy-element";
|
|
4
3
|
import { LookupResult } from "../types/lookup-result";
|
|
4
|
+
import { ListOf, MalloyElement } from "../types/malloy-element";
|
|
5
5
|
export declare class FieldReference extends ListOf<FieldName> {
|
|
6
6
|
elementType: string;
|
|
7
7
|
constructor(names: FieldName[]);
|
|
@@ -59,7 +59,7 @@ class WildcardFieldReference extends malloy_element_1.MalloyElement {
|
|
|
59
59
|
this.joinPath = joinPath;
|
|
60
60
|
this.star = star;
|
|
61
61
|
this.elementType = "wildcardFieldReference";
|
|
62
|
-
this.has({ joinPath });
|
|
62
|
+
this.has({ "joinPath": joinPath });
|
|
63
63
|
}
|
|
64
64
|
getFieldDef() {
|
|
65
65
|
throw this.internalError("fielddef request from wildcard reference");
|
|
@@ -11,7 +11,7 @@ export declare class FilterElement extends MalloyElement {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class Filter extends ListOf<FilterElement> {
|
|
13
13
|
elementType: string;
|
|
14
|
-
private havingClause?;
|
|
14
|
+
private readonly havingClause?;
|
|
15
15
|
constructor(elements?: FilterElement[]);
|
|
16
16
|
set having(isHaving: boolean);
|
|
17
17
|
getFilterList(fs: FieldSpace): FilterExpression[];
|
|
@@ -28,7 +28,7 @@ const utils_1 = require("../expressions/utils");
|
|
|
28
28
|
const malloy_element_1 = require("../types/malloy-element");
|
|
29
29
|
class FilterElement extends malloy_element_1.MalloyElement {
|
|
30
30
|
constructor(expr, exprSrc) {
|
|
31
|
-
super({ expr });
|
|
31
|
+
super({ "expr": expr });
|
|
32
32
|
this.expr = expr;
|
|
33
33
|
this.exprSrc = exprSrc;
|
|
34
34
|
this.elementType = "filterElement";
|
|
@@ -38,15 +38,15 @@ class FilterElement extends malloy_element_1.MalloyElement {
|
|
|
38
38
|
if (exprVal.dataType !== "boolean") {
|
|
39
39
|
this.expr.log("Filter expression must have boolean value");
|
|
40
40
|
return {
|
|
41
|
-
code: this.exprSrc,
|
|
42
|
-
expression: ["_FILTER_MUST_RETURN_BOOLEAN_"],
|
|
43
|
-
expressionType: "scalar"
|
|
41
|
+
"code": this.exprSrc,
|
|
42
|
+
"expression": ["_FILTER_MUST_RETURN_BOOLEAN_"],
|
|
43
|
+
"expressionType": "scalar"
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
const exprCond = {
|
|
47
|
-
code: this.exprSrc,
|
|
48
|
-
expression: (0, utils_1.compressExpr)(exprVal.value),
|
|
49
|
-
expressionType: exprVal.expressionType
|
|
47
|
+
"code": this.exprSrc,
|
|
48
|
+
"expression": (0, utils_1.compressExpr)(exprVal.value),
|
|
49
|
+
"expressionType": exprVal.expressionType
|
|
50
50
|
};
|
|
51
51
|
return exprCond;
|
|
52
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MalloyElement } from "../types/malloy-element";
|
|
2
1
|
import { FieldReferences } from "../query-items/field-references";
|
|
3
2
|
import { FieldName } from "../types/field-space";
|
|
3
|
+
import { MalloyElement } from "../types/malloy-element";
|
|
4
4
|
export declare class Index extends MalloyElement {
|
|
5
5
|
readonly fields: FieldReferences;
|
|
6
6
|
elementType: string;
|
|
@@ -26,12 +26,12 @@ exports.Index = void 0;
|
|
|
26
26
|
const malloy_element_1 = require("../types/malloy-element");
|
|
27
27
|
class Index extends malloy_element_1.MalloyElement {
|
|
28
28
|
constructor(fields) {
|
|
29
|
-
super({ fields });
|
|
29
|
+
super({ "fields": fields });
|
|
30
30
|
this.fields = fields;
|
|
31
31
|
this.elementType = "index";
|
|
32
32
|
}
|
|
33
33
|
useWeight(fn) {
|
|
34
|
-
this.has({ weightBy: fn });
|
|
34
|
+
this.has({ "weightBy": fn });
|
|
35
35
|
this.weightBy = fn;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Expr, StructDef } from "../../../model/malloy_types";
|
|
2
|
+
import { Source } from "../elements/source";
|
|
2
3
|
import { ExpressionDef } from "../types/expression-def";
|
|
3
4
|
import { FieldSpace } from "../types/field-space";
|
|
4
|
-
import { Source } from "../elements/source";
|
|
5
5
|
import { ListOf, MalloyElement, ModelEntryReference } from "../types/malloy-element";
|
|
6
6
|
export declare abstract class Join extends MalloyElement {
|
|
7
7
|
abstract name: ModelEntryReference;
|
|
@@ -31,7 +31,7 @@ class Join extends malloy_element_1.MalloyElement {
|
|
|
31
31
|
exports.Join = Join;
|
|
32
32
|
class KeyJoin extends Join {
|
|
33
33
|
constructor(name, source, keyExpr) {
|
|
34
|
-
super({ name, source, keyExpr });
|
|
34
|
+
super({ "name": name, "source": source, "keyExpr": keyExpr });
|
|
35
35
|
this.name = name;
|
|
36
36
|
this.source = source;
|
|
37
37
|
this.keyExpr = keyExpr;
|
|
@@ -41,11 +41,11 @@ class KeyJoin extends Join {
|
|
|
41
41
|
const sourceDef = this.source.structDef();
|
|
42
42
|
const joinStruct = {
|
|
43
43
|
...sourceDef,
|
|
44
|
-
structRelationship: {
|
|
45
|
-
type: "one",
|
|
46
|
-
onExpression: ["('join fixup'='not done yet')"]
|
|
44
|
+
"structRelationship": {
|
|
45
|
+
"type": "one",
|
|
46
|
+
"onExpression": ["('join fixup'='not done yet')"]
|
|
47
47
|
},
|
|
48
|
-
location: this.location
|
|
48
|
+
"location": this.location
|
|
49
49
|
};
|
|
50
50
|
if (sourceDef.structSource.type === "query") {
|
|
51
51
|
// the name from query does not need to be preserved
|
|
@@ -63,12 +63,15 @@ class KeyJoin extends Join {
|
|
|
63
63
|
if (pkey) {
|
|
64
64
|
if (pkey.type === exprX.dataType) {
|
|
65
65
|
inStruct.structRelationship = {
|
|
66
|
-
type: "one",
|
|
67
|
-
onExpression: [
|
|
68
|
-
{
|
|
66
|
+
"type": "one",
|
|
67
|
+
"onExpression": [
|
|
68
|
+
{
|
|
69
|
+
"type": "field",
|
|
70
|
+
"path": `${this.name}.${inStruct.primaryKey}`
|
|
71
|
+
},
|
|
69
72
|
"=",
|
|
70
|
-
...exprX.value
|
|
71
|
-
]
|
|
73
|
+
...exprX.value
|
|
74
|
+
]
|
|
72
75
|
};
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
@@ -88,7 +91,7 @@ class KeyJoin extends Join {
|
|
|
88
91
|
exports.KeyJoin = KeyJoin;
|
|
89
92
|
class ExpressionJoin extends Join {
|
|
90
93
|
constructor(name, source) {
|
|
91
|
-
super({ name, source });
|
|
94
|
+
super({ "name": name, "source": source });
|
|
92
95
|
this.name = name;
|
|
93
96
|
this.source = source;
|
|
94
97
|
this.elementType = "joinOnExpr";
|
|
@@ -96,7 +99,7 @@ class ExpressionJoin extends Join {
|
|
|
96
99
|
}
|
|
97
100
|
set joinOn(joinExpr) {
|
|
98
101
|
this.expr = joinExpr;
|
|
99
|
-
this.has({ on: joinExpr });
|
|
102
|
+
this.has({ "on": joinExpr });
|
|
100
103
|
}
|
|
101
104
|
get joinOn() {
|
|
102
105
|
return this.expr;
|
|
@@ -119,8 +122,8 @@ class ExpressionJoin extends Join {
|
|
|
119
122
|
const sourceDef = this.source.structDef();
|
|
120
123
|
const joinStruct = {
|
|
121
124
|
...sourceDef,
|
|
122
|
-
structRelationship: { type: this.joinType },
|
|
123
|
-
location: this.location
|
|
125
|
+
"structRelationship": { "type": this.joinType },
|
|
126
|
+
"location": this.location
|
|
124
127
|
};
|
|
125
128
|
if (sourceDef.structSource.type === "query") {
|
|
126
129
|
// the name from query does not need to be preserved
|
|
@@ -38,7 +38,7 @@ class TurtleDecl extends turtle_headed_pipe_1.TurtleHeadedPipe {
|
|
|
38
38
|
this.name = name;
|
|
39
39
|
}
|
|
40
40
|
getPipeline(fs) {
|
|
41
|
-
const modelPipe = { pipeline: [] };
|
|
41
|
+
const modelPipe = { "pipeline": [] };
|
|
42
42
|
if (this.turtleName) {
|
|
43
43
|
const headEnt = this.turtleName.getField(fs);
|
|
44
44
|
let reportWrongType = true;
|
|
@@ -79,10 +79,10 @@ class TurtleDecl extends turtle_headed_pipe_1.TurtleHeadedPipe {
|
|
|
79
79
|
}
|
|
80
80
|
const pipe = this.getPipeline(fs);
|
|
81
81
|
return {
|
|
82
|
-
type: "turtle",
|
|
83
|
-
name: this.name,
|
|
82
|
+
"type": "turtle",
|
|
83
|
+
"name": this.name,
|
|
84
84
|
...pipe,
|
|
85
|
-
location: this.location
|
|
85
|
+
"location": this.location
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -32,7 +32,7 @@ class OrderBy extends malloy_element_1.MalloyElement {
|
|
|
32
32
|
this.dir = dir;
|
|
33
33
|
this.elementType = "orderBy";
|
|
34
34
|
if (field instanceof field_space_1.FieldName) {
|
|
35
|
-
this.has({ field });
|
|
35
|
+
this.has({ "field": field });
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
get modelField() {
|
|
@@ -46,7 +46,7 @@ class OrderBy extends malloy_element_1.MalloyElement {
|
|
|
46
46
|
// this.field.log(entry.error);
|
|
47
47
|
// }
|
|
48
48
|
// }
|
|
49
|
-
const orderElement = { field: this.modelField };
|
|
49
|
+
const orderElement = { "field": this.modelField };
|
|
50
50
|
if (this.dir) {
|
|
51
51
|
orderElement.dir = this.dir;
|
|
52
52
|
}
|
|
@@ -116,7 +116,7 @@ class QOPDesc extends malloy_element_1.ListOf {
|
|
|
116
116
|
const segment = qex.finalize(this.refineThis);
|
|
117
117
|
return {
|
|
118
118
|
segment,
|
|
119
|
-
outputSpace: () => new static_space_1.StaticSpace((0, struct_utils_1.opOutputStruct)(this, inputFS.structDef(), segment))
|
|
119
|
+
"outputSpace": () => new static_space_1.StaticSpace((0, struct_utils_1.opOutputStruct)(this, inputFS.structDef(), segment))
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -33,7 +33,7 @@ class Top extends malloy_element_1.MalloyElement {
|
|
|
33
33
|
this.limit = limit;
|
|
34
34
|
this.by = by;
|
|
35
35
|
this.elementType = "top";
|
|
36
|
-
this.has({ by });
|
|
36
|
+
this.has({ "by": by });
|
|
37
37
|
}
|
|
38
38
|
getBy(fs) {
|
|
39
39
|
if (this.by) {
|
|
@@ -43,14 +43,14 @@ class Top extends malloy_element_1.MalloyElement {
|
|
|
43
43
|
// if (entry.error) {
|
|
44
44
|
// this.by.log(entry.error);
|
|
45
45
|
// }
|
|
46
|
-
return { by: "name", name: this.by.refString };
|
|
46
|
+
return { "by": "name", "name": this.by.refString };
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
const byExpr = this.by.getExpression(fs);
|
|
50
50
|
if ((0, malloy_types_1.expressionIsAggregate)(byExpr.expressionType)) {
|
|
51
51
|
this.log("top by expression must be an aggregate");
|
|
52
52
|
}
|
|
53
|
-
return { by: "expression", e: (0, utils_1.compressExpr)(byExpr.value) };
|
|
53
|
+
return { "by": "expression", "e": (0, utils_1.compressExpr)(byExpr.value) };
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return undefined;
|
|
@@ -26,7 +26,7 @@ exports.FieldListEdit = void 0;
|
|
|
26
26
|
const malloy_element_1 = require("../types/malloy-element");
|
|
27
27
|
class FieldListEdit extends malloy_element_1.MalloyElement {
|
|
28
28
|
constructor(edit, refs) {
|
|
29
|
-
super({ refs });
|
|
29
|
+
super({ "refs": refs });
|
|
30
30
|
this.edit = edit;
|
|
31
31
|
this.refs = refs;
|
|
32
32
|
this.elementType = "fieldListEdit";
|
|
@@ -26,7 +26,7 @@ exports.PrimaryKey = void 0;
|
|
|
26
26
|
const malloy_element_1 = require("../types/malloy-element");
|
|
27
27
|
class PrimaryKey extends malloy_element_1.MalloyElement {
|
|
28
28
|
constructor(field) {
|
|
29
|
-
super({ field });
|
|
29
|
+
super({ "field": field });
|
|
30
30
|
this.field = field;
|
|
31
31
|
this.elementType = "primary key";
|
|
32
32
|
}
|
|
@@ -30,7 +30,7 @@ class RenameField extends malloy_element_1.MalloyElement {
|
|
|
30
30
|
this.newName = newName;
|
|
31
31
|
this.oldName = oldName;
|
|
32
32
|
this.elementType = "renameField";
|
|
33
|
-
this.has({ oldName });
|
|
33
|
+
this.has({ "oldName": oldName });
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.RenameField = RenameField;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StructDef, StructRef } from "../../../model";
|
|
1
|
+
import { StructDef, StructRef } from "../../../model/malloy_types";
|
|
2
2
|
import { Source } from "../elements/source";
|
|
3
|
-
import { MalloyElement, ModelEntryReference } from "../types/malloy-element";
|
|
4
3
|
import { ConstantSubExpression } from "../expressions/constant-sub-expression";
|
|
4
|
+
import { MalloyElement, ModelEntryReference } from "../types/malloy-element";
|
|
5
5
|
export declare class IsValueBlock extends MalloyElement {
|
|
6
6
|
readonly isMap: Record<string, ConstantSubExpression>;
|
|
7
7
|
elementType: string;
|
|
@@ -23,11 +23,11 @@ exports.NamedSource = exports.IsValueBlock = void 0;
|
|
|
23
23
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
24
24
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
|
-
const
|
|
26
|
+
const malloy_types_1 = require("../../../model/malloy_types");
|
|
27
27
|
const source_1 = require("../elements/source");
|
|
28
|
-
const malloy_element_1 = require("../types/malloy-element");
|
|
29
28
|
const error_factory_1 = require("../error-factory");
|
|
30
29
|
const time_utils_1 = require("../time-utils");
|
|
30
|
+
const malloy_element_1 = require("../types/malloy-element");
|
|
31
31
|
class IsValueBlock extends malloy_element_1.MalloyElement {
|
|
32
32
|
constructor(isMap) {
|
|
33
33
|
super();
|
|
@@ -44,10 +44,10 @@ class NamedSource extends source_1.Source {
|
|
|
44
44
|
this.elementType = "namedSource";
|
|
45
45
|
if (paramValues && Object.keys(paramValues).length > 0) {
|
|
46
46
|
this.isBlock = new IsValueBlock(paramValues);
|
|
47
|
-
this.has({ parameterValues: this.isBlock });
|
|
47
|
+
this.has({ "parameterValues": this.isBlock });
|
|
48
48
|
}
|
|
49
49
|
if (ref instanceof malloy_element_1.ModelEntryReference) {
|
|
50
|
-
this.has({ ref });
|
|
50
|
+
this.has({ "ref": ref });
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
get refName() {
|
|
@@ -115,7 +115,7 @@ class NamedSource extends source_1.Source {
|
|
|
115
115
|
this.log(`Value given for undeclared parameter '${pName}`);
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
|
-
if ((0,
|
|
118
|
+
if ((0, malloy_types_1.isValueParameter)(decl)) {
|
|
119
119
|
if (decl.constant) {
|
|
120
120
|
pExpr.log(`Cannot override constant parameter ${pName}`);
|
|
121
121
|
}
|
|
@@ -136,7 +136,7 @@ class NamedSource extends source_1.Source {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
for (const checkDef in ret.parameters) {
|
|
139
|
-
if (!(0,
|
|
139
|
+
if (!(0, malloy_types_1.paramHasValue)(declared[checkDef])) {
|
|
140
140
|
this.log(`Value not provided for required parameter ${checkDef}`);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -26,14 +26,14 @@ exports.QuerySource = void 0;
|
|
|
26
26
|
const source_1 = require("../elements/source");
|
|
27
27
|
class QuerySource extends source_1.Source {
|
|
28
28
|
constructor(query) {
|
|
29
|
-
super({ query });
|
|
29
|
+
super({ "query": query });
|
|
30
30
|
this.query = query;
|
|
31
31
|
this.elementType = "querySource";
|
|
32
32
|
}
|
|
33
33
|
structDef() {
|
|
34
34
|
const comp = this.query.queryComp();
|
|
35
35
|
const queryStruct = comp.outputStruct;
|
|
36
|
-
queryStruct.structSource = { type: "query", query: comp.query };
|
|
36
|
+
queryStruct.structSource = { "type": "query", "query": comp.query };
|
|
37
37
|
return queryStruct;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.TableSource = void 0;
|
|
26
|
-
const error_factory_1 = require("../error-factory");
|
|
27
26
|
const source_1 = require("../elements/source");
|
|
27
|
+
const error_factory_1 = require("../error-factory");
|
|
28
28
|
class TableSource extends source_1.Source {
|
|
29
29
|
constructor(name) {
|
|
30
30
|
super();
|
|
@@ -38,14 +38,16 @@ class TableSource extends source_1.Source {
|
|
|
38
38
|
if (tableDefEntry) {
|
|
39
39
|
if (tableDefEntry.status == "present") {
|
|
40
40
|
tableDefEntry.value.location = this.location;
|
|
41
|
-
tableDefEntry.value.fields.forEach((field) =>
|
|
41
|
+
tableDefEntry.value.fields.forEach((field) => {
|
|
42
|
+
field.location = this.location;
|
|
43
|
+
});
|
|
42
44
|
return {
|
|
43
45
|
...tableDefEntry.value,
|
|
44
|
-
fields: tableDefEntry.value.fields.map((field) => ({
|
|
46
|
+
"fields": tableDefEntry.value.fields.map((field) => ({
|
|
45
47
|
...field,
|
|
46
|
-
location: this.location
|
|
48
|
+
"location": this.location
|
|
47
49
|
})),
|
|
48
|
-
location: this.location
|
|
50
|
+
"location": this.location
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
if (tableDefEntry.status == "error") {
|