I’m already supporting “append-only” incremental tables, like sign-ins (List signIns - Microsoft Graph v1.0 | Microsoft Learn) by storing the last createdDateTime (this does not uses delta actually, but it’s the same incremental pattern).
However not all destinations support it, you can get a list via this code search. I believe only Postgres and ClickHouse destinations implement handling the DeleteRecord message.
Another potential solution is to do a full sync periodically.
Another suggestion is instead of deleting the records, add a column deleted (or deleted_at) that marks it was deleted. This allows understanding which records were removed
Thank you, this is exactly what I was looking for!
We’re using SQLite as a destination, is there any plan on supporting this feature for that destination?
I found this PR that adds it to ClickHouse, I might take a stab at implementing it if that’s not on your roadmap.
Thanks for the link on the plugin: we’re actually storing delegated tokens in our database and this method of authentication is not supported in the official Entra ID plugin.
I’m having trouble generating a delete message from the source plugin, I’m using the latest postgres destination plugin and it’s either inserting the item or throwing an error cause it’s missing the primary key.
Would you have an example of a Delete message sent from a source plugin by any chance?
I ended finding how to send a delete message, I was trying to send it from the resolver in the table directly, which seems to not be supported.
I tweaked my Sync function to send a delete message and it works.
Here’s the sample code I wrote, it’s using hardcoded value (column is named column for example) but that might help someone looking to achieve the same.
That said, is there a predefined pattern for this?
I was thinking to add a channel in my client to receive the delete events that I could send from the resolvers and a goroutine launched in the Sync function that processes those messages.
We use the DeleteRecord message mostly in our AWS plugin for event based syncs AWS Plugin documentation | CloudQuery.
I was looking for some public code to share but it’s all private.
I can confirm that sending the DeleteRecord events from the Sync method is the right approach.
When doing an event based sync in our AWS plugin we have a Go routine that gets the events from a channel then process them to send the corresponding messages to the res chan<- message.SyncMessage that the Sync method receives, so quite similar to what you had in mind.