feat(transfer): add upsert mode for data transfer (#105)

Add a third transfer mode that inserts new rows and updates existing
rows based on primary key, supporting PostgreSQL, MySQL, SQLite,
SQL Server, Oracle, and DuckDB with database-specific upsert syntax.
Also fixes DuckDB primary key detection in transfer operations.
This commit is contained in:
t8y2 committed 2026-05-06 20:44:05 +08:00
1 parent 695dc07402
commit 6a3e8067e1
6 files changed
+222 -42

No files matched your search

+1
View File
@@ -137,6 +137,7 @@ export type {
SqlFileProgress,
TransferRequest,
TransferProgress,
TransferMode,
TableImportMode,
TableImportStatus,
TableImportColumnMapping,
+3 -1
View File
@@ -450,6 +450,8 @@ export async function listenSqlFileProgress(handler: (progress: SqlFileProgress)
}
// --- Data Transfer ---
export type TransferMode = "append" | "overwrite" | "upsert";
export interface TransferRequest {
transferId: string;
sourceConnectionId: string;
@@ -460,7 +462,7 @@ export interface TransferRequest {
targetSchema: string;
tables: string[];
createTable: boolean;
truncateBefore: boolean;
mode: TransferMode;
batchSize: number;
}