database transaction
A group of changes that either all happen or none do.
A transaction (BEGIN ... COMMIT/ROLLBACK) makes several statements atomic; sqlx's Transaction rolls back if dropped without commit.
Examples
let mut tx = db.begin().await?;thentx.commit().await?makes the changes permanent; droppingtxwithoutcommitrolls them all back.
See also