Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-sqlserver: Capture row preimage on updates #2223

Open
willdonnelly opened this issue Dec 19, 2024 · 0 comments
Open

source-sqlserver: Capture row preimage on updates #2223

willdonnelly opened this issue Dec 19, 2024 · 0 comments

Comments

@willdonnelly
Copy link
Member

Currently source-sqlserver doesn't capture row preimages at all when processing a CDC row update. This isn't as big a deal as you'd expect, but at some point somebody will probably want to capture before-state values as well.

This is done in SQL Server by specifying the all update old row filter option on the cdc.fn_cdc_get_all_changes_<instance> function instead of all like we currently specify, and adding some handling for __$operation values of 3 (which indicate an update preimage) to buffer them and combine with the subsequent postimage row.

We have similar logic for another connector, I think maybe Snowflake? It's not especially complicated, at least if we can assume that each preimage is immediately followed by the corresponding postimage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant