Skip to content

Commit

Permalink
fix sql param order
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 16, 2023
1 parent 8be7bc6 commit 2ca44f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (p *PostgresCDCSource) consumeStream(
consumedXLogPos = proposedConsumedXLogPos
err := p.SetLastOffset(int64(consumedXLogPos))
if err != nil {
return fmt.Errorf("[initial-flush] storing updated LSN failed: %w", err)
return fmt.Errorf("storing updated LSN failed: %w", err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ func (c *PostgresConnector) GetLastOffset(jobName string) (int64, error) {
// SetLastOffset updates the last synced offset for a job.
func (c *PostgresConnector) SetLastOffset(jobName string, lastOffset int64) error {
_, err := c.pool.
Exec(c.ctx, fmt.Sprintf(setLastOffsetSQL, c.metadataSchema, mirrorJobsTableIdentifier), jobName, lastOffset)
Exec(c.ctx, fmt.Sprintf(setLastOffsetSQL, c.metadataSchema, mirrorJobsTableIdentifier), lastOffset, jobName)
if err != nil {
return fmt.Errorf("error getting last offset for job %s: %w", jobName, err)
return fmt.Errorf("error setting last offset for job %s: %w", jobName, err)
}

return nil
Expand Down

0 comments on commit 2ca44f6

Please sign in to comment.