Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix: preload schema options when selector becomes visible (closes #244)

t8y2f3c531463672
diff --git a/src/components/layout/EditorToolbar.vue b/src/components/layout/EditorToolbar.vue
index 78f82b8d67..45b3ba4962 100644
--- a/src/components/layout/EditorToolbar.vue
+++ b/src/components/layout/EditorToolbar.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { computed } from "vue";
+import { computed, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
import {
Play,
@@ -75,6 +75,13 @@ const activeSchemaOptions = computed(() => {
return getSchemaOptionsForDb(connection.id, schemaDatabaseKey.value);
});
+watchEffect(() => {
+ const connection = props.activeConnection;
+ if (connection && showSchemaSelector.value && schemaDatabaseKey.value) {
+ loadSchemaOptions(connection.id, schemaDatabaseKey.value).catch(() => {});
+ }
+});
+
const isActiveDatabaseDefault = computed(() => isDefaultDatabase(props.activeConnection, activeDatabaseValue.value));
const toolbarStyle = computed(() => {
const color = props.activeConnection?.color;