Skip to content

Commit

Permalink
Add before to new record util. (#146)
Browse files Browse the repository at this point in the history
Some systems emit the old values when a record is deleted. This helper is extended
to allow for this.
  • Loading branch information
lyuboxa authored Jun 28, 2024
1 parent 6a89e0d commit 4cafa91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ func (SourceUtil) NewRecordDelete(
position opencdc.Position,
metadata opencdc.Metadata,
key opencdc.Data,
payloadBefore opencdc.Data,
) opencdc.Record {
if metadata == nil {
metadata = make(map[string]string)
Expand All @@ -479,5 +480,8 @@ func (SourceUtil) NewRecordDelete(
Operation: opencdc.OperationDelete,
Metadata: metadata,
Key: key,
Payload: opencdc.Change{
Before: payloadBefore,
},
}
}

0 comments on commit 4cafa91

Please sign in to comment.