Skip to content

Commit

Permalink
Write Mode Overwrite Check (#489)
Browse files Browse the repository at this point in the history
Fixes the check for write mode overwrite
  • Loading branch information
Amogh-Bharadwaj authored Oct 5, 2023
1 parent 5b9f98d commit dd178cc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nexus/flow-rs/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,17 @@ impl FlowGrpcClient {
}
}
if !cfg.initial_copy_only {
return anyhow::Result::Err(anyhow::anyhow!(
"write mode overwrite can only be set with initial_copy_only = true"
));
if let Some(QRepWriteMode {
write_type: wt,
upsert_key_columns: _,
}) = cfg.write_mode
{
if wt == QRepWriteType::QrepWriteModeOverwrite as i32 {
return anyhow::Result::Err(anyhow::anyhow!(
"write mode overwrite can only be set with initial_copy_only = true"
));
}
}
}
self.start_query_replication_flow(&cfg).await
}
Expand Down

0 comments on commit dd178cc

Please sign in to comment.