fix(completion): scoped table lookup, preserve casing, lower Oracle table-function boost

* fix: improve schema-qualified SQL completion

* fix(completion): preserve casing in completion table cache key and relaxed filter

---------

Co-authored-by: zipg <4047349+zipg@users.noreply.github.com>
Co-authored-by: t8y2 <1156263951@qq.com>
This commit is contained in:
authored and GitHub committed 2026-07-06 18:28:23 +08:00
1 parent 2fd2b0e770
commit ce096ca21f
5 files changed
+51 -9

No files matched your search

@@ -271,4 +271,15 @@ describe("sqlCompletion scoped metadata ranking", () => {
expect(items.length).toBeLessThanOrEqual(200);
expect(items[0]?.label).toBe("TempTable_000");
});
it("ranks real Oracle tables before built-in table functions in FROM contexts", () => {
const sql = "SELECT * FROM ";
const items = buildSqlCompletionItems(sql, sql.length, {
databaseType: "oracle",
tables: [{ name: "ORDERS_10K", schema: "DBX_TEST", type: "table" }],
columnsByTable: new Map(),
});
expect(items.findIndex((item) => item.label === "ORDERS_10K")).toBeLessThan(items.findIndex((item) => item.label === "TABLE"));
});
});