Skip to content

Commit

Permalink
fixing tests pt.3
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Sep 15, 2023
1 parent 318cd3a commit 3a48fa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flow/connectors/postgres/qrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ func (c *PostgresConnector) SetupQRepMetadataTables(config *protos.QRepConfig) e
"flowName": config.FlowJobName,
}).Infof("Setup metadata table.")

if config.WriteMode.WriteType == protos.QRepWriteType_QREP_WRITE_MODE_OVERWRITE {
if config.WriteMode != nil &&
config.WriteMode.WriteType == protos.QRepWriteType_QREP_WRITE_MODE_OVERWRITE {
_, err = c.pool.Exec(c.ctx, fmt.Sprintf("TRUNCATE TABLE %s", config.DestinationTableIdentifier))
if err != nil {
return fmt.Errorf("failed to TRUNCATE table before query replication: %w", err)
Expand Down

0 comments on commit 3a48fa6

Please sign in to comment.