SyncEngine Setup Updates Every Record in Synced Tables? Consider Custom Triggers? #81
Replies: 1 comment 6 replies
-
Hi @seanwoodward, good question and this is actually something I am working on right now. Overall, people will need to update their triggers to play nicely with synchronization. There is a CREATE TEMPORARY TRIGGER "…"
AFTER UPDATE ON "…"
FOR EACH ROW WHEN NOT isUpdatingWithServerRecord()
BEGIN
…
END
Or if you are using our trigger builder: createTemporaryTrigger(
"…",
after: .delete { old in
…
} when: { _ in
!isUpdatingWithServerRecord()
}
) This will make it so that our code can make updates to your tables without triggering your triggers. And we may rename this function in the near future. We named it when we thought it was an internal detail of the library, but now we see we need to publicize it. However, that line specifically that you linked to is problematic. We are doing that mass update as a shortcut to mass enqueue Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Does
syncEngineSetup
update every record in synced tables, SyncEngine.swift#L216?If so, could affect other update triggers, like last modified date. Is it worthwhile to suggest considerations when creating custom triggers for synced tables?
Beta Was this translation helpful? Give feedback.
All reactions