fix(jdbc): show schemas for generic JDBC connections

This commit is contained in:
t8y2 committed 2026-07-25 21:51:11 +08:00
1 parent 1e21a5ad52
commit 47d48a09e9
5 files changed
+144 -5

No files matched your search

+19 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { connectionObjectTreeNodeSchema, connectionQueryExecutionSchema, effectiveDatabaseTypeForConnection, inferJdbcDialect } from "@/lib/database/jdbcDialect";
import { connectionObjectTreeNodeSchema, connectionQueryExecutionSchema, connectionUsesDatabaseObjectTreeMode, effectiveDatabaseTypeForConnection, inferJdbcDialect } from "@/lib/database/jdbcDialect";
describe("jdbc dialect inference", () => {
it("detects InterSystems IRIS and Caché JDBC connections", () => {
@@ -46,6 +46,24 @@ describe("jdbc dialect inference", () => {
}),
).toBe("sqlserver");
});
it("detects GaussDB-compatible JDBC connections as schema-aware", () => {
const gaussdbConnection = {
db_type: "jdbc" as const,
connection_string: "jdbc:gaussdb://localhost:8000/testdb",
jdbc_driver_class: "com.huawei.gaussdb.jdbc.Driver",
};
const opengaussConnection = {
db_type: "jdbc" as const,
connection_string: "jdbc:opengauss://localhost:5432/postgres",
jdbc_driver_class: "org.opengauss.Driver",
};
expect(inferJdbcDialect(gaussdbConnection)).toBe("gaussdb");
expect(connectionUsesDatabaseObjectTreeMode(gaussdbConnection)).toBe(false);
expect(inferJdbcDialect(opengaussConnection)).toBe("opengauss");
expect(connectionUsesDatabaseObjectTreeMode(opengaussConnection)).toBe(false);
});
});
describe("query execution schema", () => {