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

Fix: Delete Failures in Postgres Handled #35

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Conversation

GnosisAI
Copy link
Contributor

This pull request fixes an issue in our Postgres consumer's handling of delete events, which was reported in issue #22.

In delete events, Postgres does not provide columnnames or columnvalues but instead only sends the id of the deleted row along with all column values. Our consumer now correctly captures the id from oldkeys to construct the necessary data for delete events.

Changes:

  • Updated delete event handling to fetch the id from change["oldkeys"]["keynames"][0] and change["oldkeys"]["keyvalues"][0].

Here's an example of a delete event change object that this fix accommodates:

{
  "kind": "delete",
  "schema": "public",
  "table": "products",
  "oldkeys": {
    "keynames": ["id"],
    "keytypes": ["integer"],
    "keyvalues": [25]
  }
}

@long2ice
Copy link
Owner

Thanks!

@long2ice long2ice merged commit bd93072 into long2ice:dev Nov 29, 2023
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants