feat(export): support database setup and batch SQL scripts

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-24 23:52:10 +08:00
1 parent 3d1601c807
commit 9cfee7f497
21 files changed
+622 -235

No files matched your search

+1
View File
@@ -310,6 +310,7 @@ export const listSshConfigHosts = forward("listSshConfigHosts");
// SQL File Execution
export const previewSqlFile = forward("previewSqlFile");
export const executeSqlFile = forward("executeSqlFile");
export const executeSqlFiles = forward("executeSqlFiles");
export const cancelSqlFileExecution = forward("cancelSqlFileExecution");
export const listenSqlFileProgress = forward("listenSqlFileProgress");
export const pendingOpenSqlFiles = forward("pendingOpenSqlFiles");
+4
View File
@@ -1495,6 +1495,10 @@ export async function executeSqlFile(request: SqlFileRequest): Promise<void> {
return post("/api/sql-file/execute", { request });
}
export async function executeSqlFiles(request: SqlFileRequest, filePaths: string[]): Promise<void> {
return post("/api/sql-file/execute", { request, filePaths });
}
export async function cancelSqlFileExecution(executionId: string): Promise<boolean> {
return post("/api/sql-file/cancel", { executionId });
}
+6
View File
@@ -2204,6 +2204,7 @@ export interface SqlFilePreview {
sizeBytes: number;
preview: string;
canExecuteWithoutSelectedDatabase: boolean;
establishesDatabaseContext?: boolean;
}
export interface SqlFileProgress {
@@ -2226,6 +2227,10 @@ export async function executeSqlFile(request: SqlFileRequest): Promise<void> {
return invoke("execute_sql_file", { request });
}
export async function executeSqlFiles(request: SqlFileRequest, filePaths: string[]): Promise<void> {
return invoke("execute_sql_files", { request, filePaths });
}
export async function cancelSqlFileExecution(executionId: string): Promise<boolean> {
return invoke("cancel_sql_file_execution", { executionId });
}
@@ -2467,6 +2472,7 @@ export interface DatabaseExportRequest {
includeStructure: boolean;
includeData: boolean;
includeObjects: boolean;
includeCreateDatabase?: boolean;
dropTableIfExists?: boolean;
omitAutoIncrement?: boolean;
failOnError?: boolean;