How to implement custom conflict mechanisms? #1674
-
Hi 👋 I’ve been working on both the backend and iOS to develop a remote database and an iOS client built with GRDB and a custom sync engine. Part of the sync engine’s safety mechanism relies on blocking updates if the On the backend, we’re able to perform this check, but I couldn’t find a similar API in GRDB. Am I missing something? What would be the best way to achieve this?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello @pedrommcarrasco, GRDB does not currently support the A possible solution is to perform multiple requests instead of one upsert (thus implementing the logic in the app, instead of letting the database handle it). I hear the feature request for upsert conditions, though 👍 |
Beta Was this translation helpful? Give feedback.
Hello @pedrommcarrasco,
GRDB does not currently support the
WHERE
clause of the upsert statement, so there is no direct equivalent of this Drizzle ORM construct.A possible solution is to perform multiple requests instead of one upsert (thus implementing the logic in the app, instead of letting the database handle it).
I hear the feature request for upsert conditions, though 👍