long2ice / meilisync

Realtime sync data from MySQL/PostgreSQL/MongoDB to Meilisearch
https://github.com/long2ice/meilisync
Apache License 2.0
285 stars 43 forks source link

Fix: Delete Failures in Postgres Handled #35

Closed AIForge04 closed 11 months ago

AIForge04 commented 11 months ago

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:

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 commented 11 months ago

Thanks!