fix: pass connection query timeout to execute_batch so ALTER respects configured timeout
Previously execute_batch always used the hardcoded 30s default timeout, ignoring the user's query_timeout_secs connection setting. This caused long-running ALTER TABLE statements on large tables to time out even when the user configured a longer timeout or disabled it entirely.
This commit is contained in:
1 parent
13e2cdde6f
commit
293600d9b4
5 files changed
+21
-4
No files matched your search
@@ -145,8 +145,10 @@ pub async fn execute_batch(
|
||||
database: String,
|
||||
statements: Vec<String>,
|
||||
schema: Option<String>,
|
||||
timeout_secs: Option<u64>,
|
||||
) -> Result<db::QueryResult, String> {
|
||||
dbx_core::query::execute_statements(&state, &connection_id, &database, &statements, schema.as_deref()).await
|
||||
dbx_core::query::execute_statements(&state, &connection_id, &database, &statements, schema.as_deref(), timeout_secs)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -171,6 +173,7 @@ pub async fn execute_script(
|
||||
|db_type| dbx_core::sql::split_sql_statements_for_database(&sql, db_type),
|
||||
),
|
||||
schema.as_deref(),
|
||||
None,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user