4 files changed
+111
-4
No files matched your search
@@ -20,6 +20,7 @@ import {
|
||||
gaussdbTargetServerType,
|
||||
inferJdbcDialect,
|
||||
metadataSchemaForConnection,
|
||||
objectListSchemaForConnection,
|
||||
setGaussdbConnectionMode,
|
||||
setGaussdbCountQueryDop,
|
||||
setGaussdbIdentifierQuoteStyle,
|
||||
@@ -488,3 +489,28 @@ describe("object tree node schema", () => {
|
||||
expect(connectionDatabaseMetadataSchema({ db_type: "spanner" }, "projects/p/instances/i/databases/db", "public")).toBe("public");
|
||||
});
|
||||
});
|
||||
|
||||
describe("object list schema", () => {
|
||||
it("falls back to the uppercased Dameng connection username when no schema is selected", () => {
|
||||
// Dameng's object SQL filters on a fixed WHERE o.OWNER = ?, so a blank schema
|
||||
// matches nothing and the object tab renders empty (#8301).
|
||||
expect(objectListSchemaForConnection({ db_type: "dameng", username: "sales_app" })).toBe("SALES_APP");
|
||||
});
|
||||
|
||||
it("applies the Dameng fallback to generic jdbc:dm connections", () => {
|
||||
expect(objectListSchemaForConnection({ db_type: "jdbc", connection_string: "jdbc:dm://localhost:5236", username: "sysdba" })).toBe("SYSDBA");
|
||||
});
|
||||
|
||||
it("keeps an explicitly selected schema for Dameng", () => {
|
||||
expect(objectListSchemaForConnection({ db_type: "dameng", username: "sales_app" }, "OTHER_SCHEMA")).toBe("OTHER_SCHEMA");
|
||||
});
|
||||
|
||||
it("returns a blank schema for Dameng when the connection has no usable username", () => {
|
||||
expect(objectListSchemaForConnection({ db_type: "dameng" })).toBe("");
|
||||
expect(objectListSchemaForConnection({ db_type: "dameng", username: " " })).toBe("");
|
||||
});
|
||||
|
||||
it.each(["oracle", "oceanbase-oracle", "postgres", "mysql"] as const)("does not fall back to the username for %s", (dbType) => {
|
||||
expect(objectListSchemaForConnection({ db_type: dbType, username: "app_user" })).toBe("");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user