RoMay
07/12/2021, 4:24 PM@updatedAt
- it seems the timestamp gets updated on every update of the record, even when the new dataset is exactly the same as the origin one.
Is there any way to exclude empty updates on Prisma/ORM level, so the updatedAt considers only real delta in the update scenario? I guess, this would give us less redundancy and additional a performance bonus.Ryan
07/13/2021, 5:57 AMupdate
?RoMay
07/13/2021, 8:23 AMupdatedAt
field on every update
, no matter whether the new data differ from the origin one, or not.Ryan
07/13/2021, 10:52 AMupdate
matches the existing data. You would need to check this in the application itself before calling update
I would suggest creating a feature request here with your use case so that we can look into this 🙂RoMay
07/13/2021, 11:56 AMupdatedAt
was to notify other services about new changes of the nested data. Previously we could use prisma1 subscriptions, now we try via prisma2 middleware:
1. we check the payload if it matches the relevant criteria
2. after saving in DB we wanted to check updatedAt
of nested entities whether their timestamp was updated.
3. if so, then we send an notification to other services.
But it looks like we can't rely on updatedAt
, otherwise we'll end up with many redundant notifications (in case of empty updates, which we unfortunately can't avoid).
Any suggestions though?Ryan
07/13/2021, 1:04 PMupdate
with the same data? An update call with any data should mean that the item has been updated as subscriptions do not check for the previous value.
Unfortunately the only way to do this would be in your application logic. Check if the values are same and don’t fire the update at all if they match.RoMay
07/13/2021, 2:41 PM