feat(database): Oracle data source support (#1510)

Adds Oracle as a data source through rust-oracle (ODPI-C), which loads the user's
Oracle Instant Client at runtime; the client is not bundled. The Options tab takes
the Instant Client directory (empty: ORACLE_HOME or the system library path).
Covers connecting, the schema tree, consoles with PL/SQL blocks, table editing,
Generate DDL (DBMS_METADATA), Explain Plan (PLAN_TABLE), Oracle-specific SQL
generation and completion, and jdbc:oracle:thin URLs.

Review fixes: PL/SQL units keep their closing END; (the server rejects a block
without it), a subprogram's declarations no longer split it, and packages end at
a / line; LOB cells are read through locators (they showed as null and broke
Generate DDL); ORA-01005 prompts for a password; the Instant Client directory is
optional in the dialog.

Co-authored-by: boenkkk <[email protected]>
Цей коміт міститься в:
Budi Santosoтаboenkkk authored and GitHub committed 2026-11-06 09:57:03 +08:00
1 джерело b753d3f536
коміт 9069c322e8
29 files changed
+1735 -45

No files matched your search

+13
Переглянути файл
@@ -210,6 +210,19 @@ describe("completion candidates", () => {
expect(labels(complete("select 1; ins|"))).toContain("insert into");
});
it("offers Oracle vocabulary and quotes names the server folds to upper case", () => {
expect(statementStarters("oracle")).toEqual(expect.arrayContaining(["MERGE INTO", "TRUNCATE TABLE"]));
expect(statementStarters("oracle")).not.toContain("SET search_path TO");
expect(DATA_TYPES.oracle).toEqual(expect.arrayContaining(["VARCHAR2(255)", "NUMBER", "CLOB"]));
expect(complete("SELECT | FROM users", "oracle").find((c) => c.label === "NVL")).toMatchObject({
snippet: "NVL(${})",
});
// Upper-case names are plain; lower-case ones need quotes (the server folds unquoted names).
expect(quoteIdent("EMPLOYEES", "oracle")).toBe("EMPLOYEES");
expect(quoteIdent("employees", "oracle")).toBe('"employees"');
expect(quoteIdent('a"b', "oracle")).toBe('"a""b"');
});
it("offers tables after FROM, with schema and data source", () => {
const c = complete("select * from |");
expect(labels(c, "table")).toEqual(expect.arrayContaining(["users", "orders", "order_items", "products"]));