fix: refresh sidebar after SQL file import

This commit is contained in:
t8y2
2026-05-16 12:38:53 +08:00
parent e97e965ea1
commit 70e324989c
4 changed files with 79 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import type { TreeNode } from "@/types/database";
export function findDatabaseTreeNode(nodes: TreeNode[], connectionId: string, database: string): TreeNode | null {
for (const node of nodes) {
if (node.type === "database" && node.connectionId === connectionId && node.database === database) {
return node;
}
if (node.children) {
const found = findDatabaseTreeNode(node.children, connectionId, database);
if (found) return found;
}
}
return null;
}