diff --git a/src/components/connection/ConnectionDialog.vue b/src/components/connection/ConnectionDialog.vue index 7e8a711aee..95e58301f8 100644 --- a/src/components/connection/ConnectionDialog.vue +++ b/src/components/connection/ConnectionDialog.vue @@ -214,6 +214,9 @@ function applyProfile(val: string, preserveConnectionFields = false) { form.value.port = profile.port; form.value.username = profile.user; form.value.url_params = profile.urlParams || ""; + if (profile.type === "sqlite" || profile.type === "duckdb") { + form.value.host = ""; + } } } @@ -514,6 +517,24 @@ async function browseSshKeyPath() { } } } + +async function browseDbFilePath() { + if (isTauriRuntime()) { + const { open } = await import("@tauri-apps/plugin-dialog"); + const filters = + form.value.db_type === "duckdb" + ? [{ name: "DuckDB", extensions: ["duckdb", "db"] }] + : [{ name: "SQLite", extensions: ["db", "sqlite", "sqlite3"] }]; + const selected = await open({ + title: "Select Database File", + multiple: false, + filters, + }); + if (selected && typeof selected === "string") { + form.value.host = selected; + } + } +}