feat(database): support Doris and StarRocks catalogs
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user