fix(sql-files): distinguish files with duplicate names
This commit is contained in:
1 parent
e4563f9659
commit
1dd4623919
13 files changed
+151
-12
No files matched your search
@@ -216,10 +216,7 @@ async function openFile(path: string) {
|
||||
const connectionId = connectionStore.activeConnectionId || connectionStore.connections[0]?.id || "";
|
||||
const connection = connectionId ? connectionStore.getConfig(connectionId) : undefined;
|
||||
const database = connection ? resolveDefaultDatabase(connection, []) : "";
|
||||
const name = path.split("\\").pop()?.split("/").pop() || "script.sql";
|
||||
const tabId = queryStore.createTab(connectionId, database, name, "query");
|
||||
queryStore.updateSql(tabId, content);
|
||||
queryStore.linkExternalSqlPath(tabId, path, name);
|
||||
queryStore.openExternalSqlFile(connectionId, database, path, content);
|
||||
} catch (e: any) {
|
||||
toast(t("toolbar.sqlOpenFailed", { message: e?.message || String(e) }), 5000);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user