feat(database): support Doris and StarRocks catalogs

This commit is contained in:
如梦技术 authored and GitHub committed 2026-07-30 16:03:32 +08:00
1 parent b39a0f18a4
commit adb6d86b53
44 files changed
+1330 -242

No files matched your search

@@ -1,12 +1,13 @@
import type { TreeNode } from "@/types/database";
export function findDatabaseTreeNode(nodes: TreeNode[], connectionId: string, database: string): TreeNode | null {
export function findDatabaseTreeNode(nodes: TreeNode[], connectionId: string, database: string, catalog?: string): TreeNode | null {
for (const node of nodes) {
if (node.type === "database" && node.connectionId === connectionId && node.database === database) {
const catalogMatches = catalog ? node.catalog === catalog : !node.catalog;
if (node.type === "database" && node.connectionId === connectionId && node.database === database && catalogMatches) {
return node;
}
if (node.children) {
const found = findDatabaseTreeNode(node.children, connectionId, database);
const found = findDatabaseTreeNode(node.children, connectionId, database, catalog);
if (found) return found;
}
}