Skip to content

Commit

Permalink
Merge pull request #35 from GnosisAI/dev
Browse files Browse the repository at this point in the history
Fix: Delete Failures in Postgres Handled
  • Loading branch information
long2ice authored Nov 29, 2023
2 parents 427dd2f + 5c98d02 commit bd93072
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion meilisync/source/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,23 @@ def _consumer(self, msg: ReplicationMessage):
return
columnnames = change.get("columnnames")
columnvalues = change.get("columnvalues")
values = dict(zip(columnnames, columnvalues))

if kind == "update":
values = dict(zip(columnnames, columnvalues))
event_type = EventType.update
elif kind == "delete":
values = (
dict(zip(columnnames, columnvalues))
if columnvalues
else {
change["oldkeys"]["keynames"][0]: change["oldkeys"][
"keyvalues"
][0]
}
)
event_type = EventType.delete
elif kind == "insert":
values = dict(zip(columnnames, columnvalues))
event_type = EventType.create
else:
return
Expand Down

0 comments on commit bd93072

Please sign in to comment.