Join Slack
Powered by
Hello, does any one know if there is a way in pris...
# orm-help
l
Leo Li
10/05/2021, 3:59 PM
Hello, does any one know if there is a way in prisma to only allow update a field only when it is empty? The use case is like timestamp for
createdAt
, I want to ensure the value is locked.
r
Ryan
10/06/2021, 5:32 AM
@Leo Li
👋 I don’t think you can directly do it in a single query but you can use
interactive transactions
for this use case.
l
Leo Li
10/06/2021, 12:59 PM
@Ryan
thanks, I ended up writing a DB trigger for that use case
👍 1
4
Views
Open in Slack
Previous
Next