Implement checked aggregation plans, native SQL, and bounded RPC capture

This commit is contained in:
Timothy J. Aveni
2026-09-17 19:43:46 -07:00
parent cd13120937
commit e61b0a36ac
17 changed files with 2968 additions and 100 deletions
+8 -4
View File
@@ -1307,12 +1307,12 @@ const lowerPackage = (
if (parameters.length) {
const use = identifier(clause.identifier(1));
const reason = stringValue(clause.stringLiteral()!);
if (!["select", "predicate", "order"].includes(use) || !reason.trim())
if (!["select", "predicate", "order", "aggregate", "group", "distinct"].includes(use) || !reason.trim())
loweringIssue(
state,
clause,
"invalid-query-allowance",
"Expected select/predicate/order and a nonempty reason",
"Expected select/predicate/order/aggregate/group/distinct and a nonempty reason",
);
templateAllowances.push({
interface: state.types.interface(clause.interfaceType()!),
@@ -1329,12 +1329,16 @@ const lowerPackage = (
const member = contract?.members.find((entry) => entry.displayName === identifier(clause.identifier(0)));
const use = identifier(clause.identifier(1));
const reason = stringValue(clause.stringLiteral()!);
if (!member || !["select", "predicate", "order"].includes(use) || !reason.trim())
if (
!member ||
!["select", "predicate", "order", "aggregate", "group", "distinct"].includes(use) ||
!reason.trim()
)
loweringIssue(
state,
clause,
"invalid-query-allowance",
"Query allowances name an exact member, use (select/predicate/order), and nonempty reason",
"Query allowances name an exact member, use (select/predicate/order/aggregate/group/distinct), and nonempty reason",
);
else
declaration.allowances.push({