Standardize Camino query references and retire live field sidecars

This commit is contained in:
Timothy J. Aveni
2026-09-22 15:41:27 -07:00
parent 152f58a3c6
commit eba85ba158
28 changed files with 88 additions and 217 deletions
+6 -5
View File
@@ -94,7 +94,8 @@ export function relationalCompiler(
if (!prefix(base, path)) return false;
// Object identity does not determine which incoming membership carried it.
return (
last === "entry" || !(path[base.length] === "_qx" && ["entry", "mapKey"].includes(path[base.length + 1] ?? ""))
last === "entry" ||
!(path[base.length] === "_camino" && ["entry", "mapKey"].includes(path[base.length + 1] ?? ""))
);
});
if (!ok)
@@ -153,7 +154,7 @@ export function relationalCompiler(
available?: Availability,
): QueryExpression => {
requireAvailable(names, available, node);
const meta = names.at(-2) === "_qx";
const meta = names.at(-2) === "_camino";
let fieldIndex = names.length - 1;
if (!meta) {
let cursor = root;
@@ -334,10 +335,10 @@ export function relationalCompiler(
children.push({ kind: "not", child: { kind: "and", children: children.splice(before) } });
} else if (current.kind === "pair" && (name === "source" || name === "target"))
visit(current[name], field.value, [...base, name]);
else if (name === "_qx") {
else if (name === "_camino") {
for (const meta of pairs(field.value)) {
if (meta.name.value !== "relations") {
const expr = expression(row, [...base, "_qx", meta.name.value], ["predicate"], meta, available);
const expr = expression(row, [...base, "_camino", meta.name.value], ["predicate"], meta, available);
children.push(
...(comparisons(meta.value, (operator, value) => ({
kind: "compare",
@@ -531,7 +532,7 @@ export function relationalCompiler(
expression: { ...k.expression, path: [{ kind: "source" as const }, ...k.expression.path] },
})),
{
path: ["target", "_qx", "entry"],
path: ["target", "_camino", "entry"],
expression: {
path: [{ kind: "target" as const }],
leaf: { kind: "entry" as const },