@malloydata/malloy 0.0.24-dev230216003028 → 0.0.24-dev230216173847
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.
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { BinaryBoolean } from "./binary-boolean";
|
|
2
2
|
export declare class ExprLogicalOp extends BinaryBoolean<"and" | "or"> {
|
|
3
3
|
elementType: string;
|
|
4
|
-
legalChildTypes:
|
|
5
|
-
aggregate: boolean;
|
|
6
|
-
dataType: import("../types/type-desc").FieldValueType;
|
|
7
|
-
expressionType: import("../../..").ExpressionType;
|
|
8
|
-
rawType?: string | undefined;
|
|
9
|
-
})[];
|
|
4
|
+
legalChildTypes: import("../types/type-desc").TypeDesc[];
|
|
10
5
|
}
|
|
@@ -29,7 +29,7 @@ class ExprLogicalOp extends binary_boolean_1.BinaryBoolean {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
31
31
|
this.elementType = "logical operator";
|
|
32
|
-
this.legalChildTypes = [fragtype_utils_1.FT.boolT,
|
|
32
|
+
this.legalChildTypes = [fragtype_utils_1.FT.boolT, fragtype_utils_1.FT.aggregateBoolT];
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.ExprLogicalOp = ExprLogicalOp;
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.FT = void 0;
|
|
26
|
-
function mkFragType(
|
|
27
|
-
return {
|
|
26
|
+
function mkFragType(dataType, expressionType = "scalar") {
|
|
27
|
+
return { dataType, expressionType };
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Collects functions which operate on fragtype compatible objects
|
|
@@ -97,4 +97,5 @@ FT.anyAtomicT = [
|
|
|
97
97
|
FT.timestampT,
|
|
98
98
|
FT.boolT
|
|
99
99
|
];
|
|
100
|
+
FT.aggregateBoolT = mkFragType("boolean", "aggregate");
|
|
100
101
|
//# sourceMappingURL=fragtype-utils.js.map
|
|
@@ -786,6 +786,8 @@ describe("qops", () => {
|
|
|
786
786
|
`));
|
|
787
787
|
test("where single", modelOK("query:a->{ group_by: astr; where: af > 10 }"));
|
|
788
788
|
test("having single", modelOK("query:ab->{ aggregate: acount; group_by: astr; having: acount > 10 }"));
|
|
789
|
+
test("compound having still works", modelOK("query:ab->{ aggregate: acount; having: acount > 10 and acount < 100 }"));
|
|
790
|
+
test("compound aggregate still works", modelOK("query:ab->{ aggregate: thing is acount > 10 and acount < 100 }"));
|
|
789
791
|
test("where multiple", modelOK("query:a->{ group_by: astr; where: af > 10,astr~'a%' }"));
|
|
790
792
|
test(`filters preserve source formatting in code:`, () => {
|
|
791
793
|
const model = new BetaModel(`source: notb is a + { where: astr != 'b' }`);
|