public static class SqlGuardResponse.JoinFact extends Object
WRONG_JOIN_PATH rule
(blueprint §S24). Populated only when both sides bind to catalog
columns.
joinPath — the equality the SQL wrote, in canonical
form: "left.table.col = right.table.col" (lowercased,
fully-qualified to disambiguate identical-name tables).joinPathMatchesForeignKey — true when the
predicate's columns line up with a catalog FK between the
two tables (in either direction). false otherwise.expectedForeignKeyPath — non-null only when an FK
exists between the joined tables but the predicate doesn't
match it. Carries the canonical "correct" predicate so the
BFF can surface a Did-you-mean.Wire-format change in S24. Pre-S24, facts.joins
was always serialized as []. S24 introduces typed
JoinFact entries; downstream consumers can no longer
assume the array is empty. joinPath and
joinPathMatchesForeignKey are always present on each
entry; expectedForeignKeyPath is OMITTED from the JSON
when null (i.e. for FK-matching joins and joins between tables
with no FK relationship at all). Joins whose sides don't catalog-
bind are NOT emitted (CTEs, subquery aliases, etc.).
Single-column FK only (V1). The matching logic uses
ConstraintModel
entries whose columns().size() == 1 &&
referencedColumns().size() == 1. Composite-FK queries currently
report joinPathMatchesForeignKey:false and do NOT fire
WRONG_JOIN_PATH (because no single-column FK exists between the
tables — the rule stays silent rather than misfire). Multi-
column FK correlation is deferred to blueprint B8 (TODO #15).
| Modifier and Type | Field and Description |
|---|---|
String |
expectedForeignKeyPath |
String |
joinPath |
boolean |
joinPathMatchesForeignKey |
| Constructor and Description |
|---|
JoinFact() |
public boolean joinPathMatchesForeignKey
public String expectedForeignKeyPath
public JoinFact()