pub struct WriteOptions {
pub mode: WriteMode,
pub batch_size: usize,
pub key_columns: Vec<String>,
pub bulk_mode: BulkMode,
pub copy_format: CopyFormat,
pub atomic: bool,
pub isolate_failures: bool,
pub verbose: bool,
}Expand description
Configuration for a batched write.
Fields§
§mode: WriteModeConflict semantics. Default WriteMode::Insert.
batch_size: usizeRows per batch. 0 is treated as DEFAULT_WRITE_BATCH.
key_columns: Vec<String>Conflict-key columns for WriteMode::Skip / WriteMode::Upsert.
Must be a subset of columns. Empty is rejected for those modes.
bulk_mode: BulkModeRoute batches through the destination’s native bulk loader
(BulkMode::Auto / BulkMode::On). Ignored for the
conflict modes, whose bulk loaders carry no MERGE semantics.
copy_format: CopyFormatPostgres COPY wire format for the bulk path. Other backends
ignore it.
atomic: boolWrap the whole write in one outer transaction: all batches commit
together or roll back together. Uses the same per-backend
BEGIN/COMMIT/ROLLBACK as migrate’s atomic apply — MSSQL adds
SET XACT_ABORT ON; Oracle gets an explicit COMMIT. A batch
failure under atomic rolls the whole write back and the report
records the failing batch.
isolate_failures: boolOn a batch failure, retry that batch one row at a time to
pinpoint the rejected rows (recorded as RejectedRows) and let
the good rows through. Off by default — the cheaper per-batch
granularity rejects the whole failing batch. Mutually weakened by
atomic: under one outer transaction a row probe cannot commit
partial good rows, so isolate_failures only refines the
diagnosis, not the commit boundary.
verbose: boolEmit per-batch diagnostics on stderr (bulk path selection /
fallback). Mirrors the CLI --verbose flag.