feat(metadata): honor system schema visibility
This commit is contained in:
1 parent
a07def6042
commit
820b8cd26f
44 files changed
+422
-47
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { schemaOptionsForConnection } from "@/composables/useSchemaOptions";
|
||||
import { schemaOptionsCacheKey, schemaOptionsForConnection } from "@/composables/useSchemaOptions";
|
||||
|
||||
describe("schemaOptionsForConnection", () => {
|
||||
it("sorts schema names with numeric suffixes naturally", () => {
|
||||
@@ -19,4 +19,19 @@ describe("schemaOptionsForConnection", () => {
|
||||
|
||||
expect(schemaOptionsForConnection(["WMWMSE10", "SYSTEM", "WMWMSE2", "WMWMSE1"], connection, "ORCL")).toEqual(["WMWMSE2", "WMWMSE10"]);
|
||||
});
|
||||
|
||||
it.each(["opengauss", "kingbase"] as const)("includes system schemas for %s when enabled", (dbType) => {
|
||||
expect(
|
||||
schemaOptionsForConnection(["information_schema", "pg_catalog", "public"], {
|
||||
db_type: dbType,
|
||||
show_system_schemas: true,
|
||||
}),
|
||||
).toEqual(["information_schema", "pg_catalog", "public"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("schemaOptionsCacheKey", () => {
|
||||
it("separates hidden and visible system-schema results", () => {
|
||||
expect(schemaOptionsCacheKey("connection-1", "postgres", false)).not.toBe(schemaOptionsCacheKey("connection-1", "postgres", true));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user