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(table-paste): let long data-copy statements run without client timeout

zipgf0e80bc97f60
diff --git a/apps/desktop/src/components/objects/ObjectBrowser.vue b/apps/desktop/src/components/objects/ObjectBrowser.vue
index b751f05442..734abb1e3a 100644
--- a/apps/desktop/src/components/objects/ObjectBrowser.vue
+++ b/apps/desktop/src/components/objects/ObjectBrowser.vue
@@ -2828,7 +2828,7 @@ async function confirmPasteTable() {
identifierQuote: connectionStore.connectionIdentifierQuote?.(props.connection.id),
...dataCopyColumnOptions,
});
- const executed = await executeObjectBrowserSqlWithProductionGuard(dataSql, () => api.executeQuery(props.connection.id, props.database, dataSql, schema));
+ const executed = await executeObjectBrowserSqlWithProductionGuard(dataSql, () => api.executeQuery(props.connection.id, props.database, dataSql, schema, undefined, { timeoutSecs: 0 }));
if (!executed) {
pasteCancelled = true;
break;
diff --git a/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue b/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue
index df88505bf9..b8cffccd7c 100644
--- a/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue
+++ b/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue
@@ -3393,6 +3393,7 @@ async function executeTreeNodeSqlWithProductionGuard(
isCancelledBeforeDispatch?: () => boolean;
beforeExecute?: () => Promise<void>;
markDispatched?: () => void;
+ timeoutSecs?: number;
} = {},
) {
if (!node.connectionId) return undefined;
@@ -3418,7 +3419,7 @@ async function executeTreeNodeSqlWithProductionGuard(
await options.beforeExecute?.();
if (options.isCancelledBeforeDispatch?.()) throw new Error("Operation cancelled before it was sent to the database.");
options.markDispatched?.();
- return options.executeAsScript ? api.executeScript(node.connectionId!, database, sql, options.schema ?? node.schema) : api.executeQuery(node.connectionId!, database, sql, options.schema ?? node.schema, executionId, { timeoutSecs });
+ return options.executeAsScript ? api.executeScript(node.connectionId!, database, sql, options.schema ?? node.schema) : api.executeQuery(node.connectionId!, database, sql, options.schema ?? node.schema, executionId, { timeoutSecs: options.timeoutSecs ?? timeoutSecs });
},
});
}
@@ -4845,7 +4846,7 @@ async function confirmPasteTable() {
identifierQuote: connectionStore.connectionIdentifierQuote?.(entry.connectionId),
...dataCopyColumnOptions,
});
- const dataExecuted = await executeTreeNodeSqlWithProductionGuard(entry, dataSql, { database: entry.database, schema: entry.schema });
+ const dataExecuted = await executeTreeNodeSqlWithProductionGuard(entry, dataSql, { database: entry.database, schema: entry.schema, timeoutSecs: 0 });
if (!dataExecuted) {
pasteCancelled = true;
break;