How can I perform the following SQL statement in Rust with sea-orm?
UPDATE user SET balance = balance - debit
I've tried the following:
let updated = user::ActiveModel::update(&db)
.set_expr(user::Column::Balance, user::Column::Balance - 100)
.exec()
.await.unwrap_or_default();
But this option doesn't work.
I found the answer: