-
|
From the example code let pear: Optionfruit::Model = Fruit::find_by_id(28).one(db).await?; // Into ActiveModel // Update name attribute // Update corresponding row in database using primary key value eg the example code is not protected by a transaction so if another thread deleted the pear between the find and the update then I assume the update would fail, but I'm not sure how to check for this. Basically, I was looking for an equivalent to the DeleteResult where I can check rows_affected. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Sorry. Just realised I'm missing the point of await returning a Result (I think). |
Beta Was this translation helpful? Give feedback.
Sorry. Just realised I'm missing the point of await returning a Result (I think).