Support checked keyed relationships across portable operations and queries
This commit is contained in:
@@ -53,11 +53,11 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
|
||||
});
|
||||
} else {
|
||||
const endpoints = storage.endpoints.map((endpoint) => {
|
||||
if (endpoint.ordered || endpoint.keyType || endpoint.retainOther)
|
||||
if (endpoint.ordered || (endpoint.keyType && endpoint.keyType !== "string") || endpoint.retainOther)
|
||||
throw new ExecutionPlanError(
|
||||
"UNSUPPORTED_GRAPH_FEATURE",
|
||||
storage.id,
|
||||
"Ordered/keyed relations and automatic retention are not implemented",
|
||||
"Ordered relations, non-string keys and automatic retention are not implemented",
|
||||
);
|
||||
return {
|
||||
projection: endpoint.projectionId,
|
||||
@@ -69,6 +69,7 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
|
||||
: endpoint.constraint.interfaceRevisionId,
|
||||
},
|
||||
cardinality: endpoint.cardinality,
|
||||
...(endpoint.keyType ? { keyType: endpoint.keyType } : {}),
|
||||
...(endpoint.onDelete ? { onDelete: endpoint.onDelete } : {}),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -10,11 +10,7 @@ export function unsupportedQueryOperator(query: CheckedQuery): string | undefine
|
||||
if (value.kind === "reduce") return "aggregate predicates";
|
||||
if (value.kind === "and" || value.kind === "or") return value.children.map(predicate).find(Boolean);
|
||||
if (value.kind === "not") return predicate(value.child);
|
||||
if (value.kind === "compare")
|
||||
return (
|
||||
path(value.expression.path) ??
|
||||
(value.expression.leaf.kind === "mapKey" ? "keyed relationship operands" : undefined)
|
||||
);
|
||||
if (value.kind === "compare") return path(value.expression.path);
|
||||
if (value.kind === "relation") return path(value.path) ?? (value.predicate && predicate(value.predicate));
|
||||
return undefined;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user