fix(doris): preserve single external catalog visibility
This commit is contained in:
1 parent
68179d16f5
commit
5792ce1244
3 files changed
+30
-4
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import type { ConnectionConfig, DatabaseType, TreeNodeType } from "@/types/database";
|
||||
import type { CatalogInfo, ConnectionConfig, DatabaseType, TreeNodeType } from "@/types/database";
|
||||
import { supportsDatabaseFeature } from "@/lib/database/databaseDriverManifest";
|
||||
import { canEditTableStructure } from "@/lib/table/tableStructureCapabilities";
|
||||
import { CLEARABLE_QUERY_SCHEMA_TYPES, DATABASE_OBJECT_TREE_TYPES, DATABASE_SCHEMA_QUALIFIED_TYPES, FETCH_FIRST_TYPES, PG_LIKE_STRUCTURE_TYPES, PG_VACUUM_TYPES, SCHEMA_AWARE_TYPES, SINGLE_DATABASE_TYPES, TREE_SCHEMA_TYPES } from "@/lib/database/databaseCapabilitySets";
|
||||
@@ -45,6 +45,15 @@ export function isInternalDorisCatalog(catalogType?: string | null, catalogName?
|
||||
return (catalogName ?? "").trim() === "internal";
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep the catalog grouping layer whenever SHOW CATALOGS exposes an external
|
||||
* catalog. A single visible external catalog still carries namespace
|
||||
* information that cannot be represented by the flat database tree.
|
||||
*/
|
||||
export function shouldShowDorisCatalogTree(catalogs: readonly CatalogInfo[]): boolean {
|
||||
return catalogs.some((catalog) => !isInternalDorisCatalog(catalog.catalog_type, catalog.name));
|
||||
}
|
||||
|
||||
export function usesTreeSchemaMode(dbType?: DatabaseType): boolean {
|
||||
return !!dbType && TREE_SCHEMA_TYPES.has(dbType);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user