+
+
+ {{ t("sqlFileTree.noFolder") }}
+
+
-
-
-
-
-
-
- {{ folderName(folder.path) }}
- {{ folder.path }}
-
-
-
-
-
-
- {{ t("sqlFileTree.loading") }}
-
-
- {{ t("sqlFileTree.noSqlFiles") }}
-
-
-
-
+
+
+
-
-
-
-
-
-
-
- {{ entry.name }}
+
+ {{ folderName(folder.path) }}
+ {{ folder.path }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t("sqlFileTree.loading") }}
+
+
+ {{ t("sqlFileTree.noSqlFiles") }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ entry.name }}
+
+
+
-
-
+
+
diff --git a/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue b/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue
index dac1488c28..33be9eab70 100644
--- a/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue
+++ b/apps/desktop/src/components/sql-file/SqlFileExecutionDialog.vue
@@ -27,6 +27,7 @@ const open = defineModel
("open", { default: false });
const props = defineProps<{
prefillConnectionId?: string;
prefillDatabase?: string;
+ prefillFilePath?: string;
}>();
const store = useConnectionStore();
@@ -410,6 +411,11 @@ watch(
if (connectionId.value) {
loadDatabasesForConnection(connectionId.value);
}
+ // When opened from the SQL Files panel with a pre-selected file, load its
+ // preview automatically so the user can review statements before running.
+ if (props.prefillFilePath) {
+ void loadPreview(props.prefillFilePath);
+ }
},
{ immediate: true },
);
diff --git a/apps/desktop/src/composables/useDialogSources.ts b/apps/desktop/src/composables/useDialogSources.ts
index ab2068049f..8d75230790 100644
--- a/apps/desktop/src/composables/useDialogSources.ts
+++ b/apps/desktop/src/composables/useDialogSources.ts
@@ -32,6 +32,7 @@ const dataComparePrefillSchema = ref("");
const dataComparePrefillTable = ref("");
const sqlFilePrefillConnectionId = ref("");
const sqlFilePrefillDatabase = ref("");
+const sqlFilePrefillFilePath = ref("");
const diagramPrefillConnectionId = ref("");
const diagramPrefillDatabase = ref("");
const diagramPrefillSchema = ref("");
@@ -115,12 +116,22 @@ export function useDialogSources() {
if (v) {
sqlFilePrefillConnectionId.value = v.connectionId;
sqlFilePrefillDatabase.value = v.database;
+ sqlFilePrefillFilePath.value = v.filePath ?? "";
showSqlFileDialog.value = true;
connectionStore.sqlFileSource = null;
}
},
);
+ // Clear the pre-filled file path once the dialog closes so a later open
+ // via the toolbar (which doesn't go through sqlFileSource) doesn't re-load
+ // the previously previewed file. prefillConnectionId/database are harmless
+ // when stale (they only preselect dropdowns), but a stale path triggers an
+ // async file read + preview render — a visible side effect.
+ watch(showSqlFileDialog, (open) => {
+ if (!open) sqlFilePrefillFilePath.value = "";
+ });
+
watch(
() => connectionStore.diagramSource,
(v) => {
@@ -305,6 +316,7 @@ export function useDialogSources() {
dataComparePrefillTable,
sqlFilePrefillConnectionId,
sqlFilePrefillDatabase,
+ sqlFilePrefillFilePath,
diagramPrefillConnectionId,
diagramPrefillDatabase,
diagramPrefillSchema,
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index 78b8e298fb..17ef13c083 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -2462,6 +2462,18 @@ export default {
openFailed: "Failed to open folder: {message}",
loadFailed: "Failed to load SQL files: {message}",
desktopOnly: "This feature is only available on desktop",
+ refreshFolder: "Refresh folder",
+ refreshAll: "Refresh all",
+ refreshed: "Refreshed",
+ revealInFileManager: "Reveal in file manager",
+ revealFailed: "Failed to open file manager: {message}",
+ copyPath: "Copy path",
+ pathCopied: "Path copied",
+ copyFailed: "Failed to copy path",
+ openFile: "Open",
+ executeSqlFile: "Execute SQL file",
+ expandAll: "Expand all",
+ collapseAll: "Collapse all",
},
diff: {
title: "Compare Schemas",
diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts
index 27edb527c9..7ae2bf4fcf 100644
--- a/apps/desktop/src/i18n/locales/es.ts
+++ b/apps/desktop/src/i18n/locales/es.ts
@@ -3399,5 +3399,17 @@ export default withEnglishFallback({
openFailed: "Error al abrir la carpeta: {message}",
loadFailed: "Error al cargar archivos SQL: {message}",
desktopOnly: "Esta función solo está disponible en la versión de escritorio",
+ refreshFolder: "Actualizar carpeta",
+ refreshAll: "Actualizar todo",
+ refreshed: "Actualizado",
+ revealInFileManager: "Mostrar en el explorador de archivos",
+ revealFailed: "Error al abrir el explorador de archivos: {message}",
+ copyPath: "Copiar ruta",
+ pathCopied: "Ruta copiada",
+ copyFailed: "Error al copiar la ruta",
+ openFile: "Abrir",
+ executeSqlFile: "Ejecutar archivo SQL",
+ expandAll: "Expandir todo",
+ collapseAll: "Contraer todo",
},
});
diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts
index 70653ec05c..5753e12de8 100644
--- a/apps/desktop/src/i18n/locales/it.ts
+++ b/apps/desktop/src/i18n/locales/it.ts
@@ -3397,5 +3397,17 @@ export default withEnglishFallback({
openFailed: "Apertura cartella fallita: {message}",
loadFailed: "Caricamento file SQL fallito: {message}",
desktopOnly: "Questa funzionalità è disponibile solo su desktop",
+ refreshFolder: "Aggiorna cartella",
+ refreshAll: "Aggiorna tutto",
+ refreshed: "Aggiornato",
+ revealInFileManager: "Mostra nel file manager",
+ revealFailed: "Apertura del file manager non riuscita: {message}",
+ copyPath: "Copia percorso",
+ pathCopied: "Percorso copiato",
+ copyFailed: "Copia del percorso non riuscita",
+ openFile: "Apri",
+ executeSqlFile: "Esegui file SQL",
+ expandAll: "Espandi tutto",
+ collapseAll: "Comprimi tutto",
},
});
diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts
index 7d22d7ce66..b5f795e0aa 100644
--- a/apps/desktop/src/i18n/locales/ja.ts
+++ b/apps/desktop/src/i18n/locales/ja.ts
@@ -3397,5 +3397,17 @@ export default withEnglishFallback({
openFailed: "フォルダを開くのに失敗しました: {message}",
loadFailed: "SQL ファイルの読み込みに失敗しました: {message}",
desktopOnly: "この機能はデスクトップ版のみで利用可能です",
+ refreshFolder: "フォルダーをリフレッシュ",
+ refreshAll: "すべてをリフレッシュ",
+ refreshed: "リフレッシュ済み",
+ revealInFileManager: "ファイルマネージャーで表示",
+ revealFailed: "ファイルマネージャーを開けませんでした: {message}",
+ copyPath: "パスをコピー",
+ pathCopied: "パスをコピーしました",
+ copyFailed: "パスのコピーに失敗しました",
+ openFile: "開く",
+ executeSqlFile: "SQLファイルを実行",
+ expandAll: "すべて展開",
+ collapseAll: "すべて折りたたむ",
},
});
diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts
index 6267349358..008becade0 100644
--- a/apps/desktop/src/i18n/locales/pt-BR.ts
+++ b/apps/desktop/src/i18n/locales/pt-BR.ts
@@ -3398,5 +3398,17 @@ export default withEnglishFallback({
openFailed: "Falha ao abrir a pasta: {message}",
loadFailed: "Falha ao carregar arquivos SQL: {message}",
desktopOnly: "Recurso disponível apenas no desktop",
+ refreshFolder: "Atualizar pasta",
+ refreshAll: "Atualizar tudo",
+ refreshed: "Atualizado",
+ revealInFileManager: "Mostrar no gerenciador de arquivos",
+ revealFailed: "Falha ao abrir o gerenciador de arquivos: {message}",
+ copyPath: "Copiar caminho",
+ pathCopied: "Caminho copiado",
+ copyFailed: "Falha ao copiar caminho",
+ openFile: "Abrir",
+ executeSqlFile: "Executar arquivo SQL",
+ expandAll: "Expandir todos",
+ collapseAll: "Recolher todos",
},
});
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index b698c80f43..f388c7b9cf 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -2462,6 +2462,18 @@ export default withEnglishFallback({
openFailed: "打开文件夹失败: {message}",
loadFailed: "加载 SQL 文件失败: {message}",
desktopOnly: "此功能仅在桌面端可用",
+ refreshFolder: "刷新文件夹",
+ refreshAll: "刷新全部",
+ refreshed: "已刷新",
+ revealInFileManager: "在文件管理器中显示",
+ revealFailed: "打开文件管理器失败: {message}",
+ copyPath: "复制路径",
+ pathCopied: "路径已复制",
+ copyFailed: "复制路径失败",
+ openFile: "打开",
+ executeSqlFile: "执行 SQL 文件",
+ expandAll: "全部展开",
+ collapseAll: "全部折叠",
},
diff: {
title: "比较架构",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index 0c58ce5697..52856ee1bf 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -3398,5 +3398,17 @@ export default withEnglishFallback({
openFailed: "開啟資料夾失敗: {message}",
loadFailed: "載入 SQL 檔案失敗: {message}",
desktopOnly: "此功能僅在桌面端可用",
+ refreshFolder: "重新整理資料夾",
+ refreshAll: "重新整理全部",
+ refreshed: "已重新整理",
+ revealInFileManager: "在檔案管理員中顯示",
+ revealFailed: "開啟檔案管理員失敗: {message}",
+ copyPath: "複製路徑",
+ pathCopied: "路徑已複製",
+ copyFailed: "複製路徑失敗",
+ openFile: "開啟",
+ executeSqlFile: "執行 SQL 檔案",
+ expandAll: "全部展開",
+ collapseAll: "全部摺疊",
},
});
diff --git a/apps/desktop/src/stores/connectionStore.ts b/apps/desktop/src/stores/connectionStore.ts
index 6e448f834d..83beb1a8e5 100644
--- a/apps/desktop/src/stores/connectionStore.ts
+++ b/apps/desktop/src/stores/connectionStore.ts
@@ -251,7 +251,7 @@ export const useConnectionStore = defineStore("connection", () => {
schema?: string;
tableName?: string;
} | null>(null);
- const sqlFileSource = ref<{ connectionId: string; database: string } | null>(null);
+ const sqlFileSource = ref<{ connectionId: string; database: string; filePath?: string } | null>(null);
const diagramSource = ref<{
connectionId: string;
database: string;