feat(connection): select new databases when visible
This commit is contained in:
4 files changed
+32
-1
No files matched your search
@@ -2989,6 +2989,7 @@ async function createDuckDbAttachedDatabaseFile() {
|
||||
attached_databases: [...(config.attached_databases ?? []), { name, path }],
|
||||
});
|
||||
}
|
||||
await connectionStore.ensureVisibleDatabase(node.connectionId, name);
|
||||
await connectionStore.loadDatabases(node.connectionId, { force: true });
|
||||
connectionStore.selectedTreeNodeId = `${node.connectionId}:${name}`;
|
||||
toast(t("contextMenu.createDuckDbFileSuccess", { name }), 3000);
|
||||
@@ -3008,6 +3009,7 @@ async function confirmCreateDatabase() {
|
||||
if (config?.db_type === "mongodb") {
|
||||
await api.mongoCreateDatabase(node.connectionId, name);
|
||||
toast(t("contextMenu.createDatabaseSuccess", { name }), 3000);
|
||||
await connectionStore.ensureVisibleDatabase(node.connectionId, name);
|
||||
await connectionStore.loadMongoDatabases(node.connectionId);
|
||||
return;
|
||||
}
|
||||
@@ -3021,6 +3023,7 @@ async function confirmCreateDatabase() {
|
||||
});
|
||||
await api.executeQuery(node.connectionId, "", sql);
|
||||
toast(t("contextMenu.createDatabaseSuccess", { name }), 3000);
|
||||
await connectionStore.ensureVisibleDatabase(node.connectionId, name);
|
||||
await connectionStore.loadDatabases(node.connectionId, { force: true });
|
||||
} catch (e: any) {
|
||||
toast(t("contextMenu.tableOperationFailed", { message: e?.message || String(e) }), 5000);
|
||||
|
||||
Reference in new issue
Block a user