fix: sort tables by FK dependency in transfer and export
This commit is contained in:
1 parent
71db24813e
commit
c4c427fb67
11 files changed
+292
-6
No files matched your search
@@ -221,6 +221,7 @@ export const readExternalSqlFile = forward("readExternalSqlFile");
|
||||
// Data Transfer
|
||||
export const startTransfer = forward("startTransfer");
|
||||
export const cancelTransfer = forward("cancelTransfer");
|
||||
export const sortTablesByFkDependency = forward("sortTablesByFkDependency");
|
||||
|
||||
// Table File Import
|
||||
export const previewTableImportFile = forward("previewTableImportFile");
|
||||
|
||||
@@ -26,6 +26,9 @@ export interface BuildDatabaseSqlExportOptions {
|
||||
tables: ExportedTableSql[];
|
||||
rowLimitPerTable?: number;
|
||||
insertBatchSize?: number;
|
||||
connectionId?: string;
|
||||
database?: string;
|
||||
schema?: string;
|
||||
}
|
||||
|
||||
export interface BuildExportInsertStatementsOptions {
|
||||
|
||||
@@ -1056,6 +1056,18 @@ export async function cancelTransfer(transferId: string): Promise<void> {
|
||||
return post("/api/transfer/cancel", { transferId });
|
||||
}
|
||||
|
||||
export interface SortTablesByFkOptions {
|
||||
connectionId: string;
|
||||
database: string;
|
||||
schema: string;
|
||||
tables: string[];
|
||||
parentsFirst: boolean;
|
||||
}
|
||||
|
||||
export async function sortTablesByFkDependency(options: SortTablesByFkOptions): Promise<string[]> {
|
||||
return post("/api/transfer/sort-tables-by-fk", options);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Table File Import
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -1479,6 +1479,24 @@ export async function cancelTransfer(transferId: string): Promise<void> {
|
||||
return invoke("cancel_transfer", { transferId });
|
||||
}
|
||||
|
||||
export interface SortTablesByFkOptions {
|
||||
connectionId: string;
|
||||
database: string;
|
||||
schema: string;
|
||||
tables: string[];
|
||||
parentsFirst: boolean;
|
||||
}
|
||||
|
||||
export async function sortTablesByFkDependency(options: SortTablesByFkOptions): Promise<string[]> {
|
||||
return invoke("sort_tables_by_fk_dependency", {
|
||||
connectionId: options.connectionId,
|
||||
database: options.database,
|
||||
schema: options.schema,
|
||||
tables: options.tables,
|
||||
parentsFirst: options.parentsFirst,
|
||||
});
|
||||
}
|
||||
|
||||
// --- Table File Import ---
|
||||
export type TableImportMode = "append" | "truncate";
|
||||
export type TableImportStatus = "running" | "done" | "error" | "cancelled";
|
||||
|
||||
Reference in new issue
Block a user