fix(desktop): scope SQL alias completions to columns

This commit is contained in:
t8y2 committed 2026-06-01 19:31:49 +08:00
1 parent b35c1486e6
commit 41e97baa6e
3 files changed
+90 -1

No files matched your search

+6
View File
@@ -1926,6 +1926,12 @@ function buildJoinConditionItemsForPair(
) {
boost = 1800;
}
// Pattern 7: Generic FK column → id when table names do not reveal the relationship.
else if (leftName !== "id" && leftName.endsWith("_id") && rightName === "id") {
boost = 1650;
} else if (rightName !== "id" && rightName.endsWith("_id") && leftName === "id") {
boost = 1650;
}
if (!boost) continue;
const label = `${leftLabel} = ${rightLabel}`;