feat(desktop): show batch drop progress
This commit is contained in:
11 files changed
+453
-37
No files matched your search
@@ -820,6 +820,37 @@ export async function executeMulti(
|
||||
return post("/api/query/execute-multi", { connectionId, database, sql, schema, executionId, ...options });
|
||||
}
|
||||
|
||||
export interface ExecuteMultiProgress {
|
||||
executionId: string;
|
||||
completed: number;
|
||||
total: number;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export async function executeMultiWithProgress(
|
||||
connectionId: string,
|
||||
database: string,
|
||||
sql: string,
|
||||
onProgress: (progress: ExecuteMultiProgress) => void,
|
||||
schema?: string,
|
||||
options?: {
|
||||
maxRows?: number;
|
||||
fetchSize?: number;
|
||||
pageSize?: number;
|
||||
resultSessionId?: string;
|
||||
clientSessionId?: string;
|
||||
timeoutSecs?: number;
|
||||
useTransaction?: boolean;
|
||||
continueOnError?: boolean;
|
||||
executionMode?: "simple";
|
||||
},
|
||||
): Promise<QueryResult[]> {
|
||||
const executionId = crypto.randomUUID();
|
||||
const results = await executeMulti(connectionId, database, sql, schema, executionId, options);
|
||||
onProgress({ executionId, completed: results.length, total: results.length, success: !results.some((result) => result.execution_error === true) });
|
||||
return results;
|
||||
}
|
||||
|
||||
export async function closeQuerySession(connectionId: string, database: string, sessionId: string, clientSessionId?: string): Promise<boolean> {
|
||||
return post("/api/query/close-session", { connectionId, database, sessionId, clientSessionId });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user