fix(schema): list table sequences for kingbase and vastbase

This commit is contained in:
zipg authored and GitHub committed 2026-09-26 21:44:29 +08:00
1 parent 2b38509768
commit a8006a1fdd
4 files changed
+630 -14

No files matched your search

@@ -111,6 +111,13 @@ describe("databaseObjectCapabilities", () => {
expect(sidebarObjectKindsForDatabase("vastbase")).not.toContain("TRIGGER");
});
it("exposes sequences for Kingbase and Vastbase via the agent PostgreSQL catalogs", () => {
for (const dbType of ["kingbase", "vastbase"] as const) {
expect(sidebarObjectKindsForDatabase(dbType), dbType).toContain("SEQUENCE");
expect(databaseObjectCapabilities(dbType).sourceReadable, dbType).toContain("SEQUENCE");
}
});
it("only Xugu TYPE nodes can open object source", () => {
expect(supportsTypeObjectSource("xugu")).toBe(true);
for (const dbType of ["postgres", "opengauss", "gaussdb", "kingbase", "vastbase", undefined] as const) {
@@ -25,11 +25,12 @@ const OPENGAUSS_A_OBJECTS: SidebarObjectKind[] = [...POSTGRES_OBJECTS, "PACKAGE"
const POSTGRES_NO_TYPE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION", "SEQUENCE"];
// Kingbase and Vastbase agents support the same user-defined type listing via
// their own metadata query, but do not expose sequences. Kingbase additionally
// has a verified schema-trigger path; keep Vastbase separate until its Agent
// their own metadata query, and their sequences are read from the PostgreSQL
// catalogs over the agent connection (t8y2/dbx#9016). Kingbase additionally has
// a verified schema-trigger path; keep Vastbase separate until its Agent
// exposes the same parent-table-aware metadata contract.
const KINGBASE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION", "TRIGGER", "TYPE"];
const VASTBASE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION", "TYPE"];
const KINGBASE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION", "TRIGGER", "SEQUENCE", "TYPE"];
const VASTBASE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION", "SEQUENCE", "TYPE"];
const POSTGRES_LIKE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION"];
const ORACLE_OBJECTS: SidebarObjectKind[] = ["TABLE", "VIEW", "MATERIALIZED_VIEW", "PROCEDURE", "FUNCTION", "SEQUENCE", "SYNONYM", "PACKAGE", "PACKAGE_BODY"];