transaction
Groups multiple sql steps into one atomic transaction. A failure in any nested query rolls back the entire block.
Declaration
Attributes
Nested steps may reference each other's results in the normal way.
Rollback semantics
1. Query failure
A query error triggers an immediate ROLLBACK.
2. Caught constraint failure
A catch block that aborts with a status also rolls back and writes its error payload directly to the client.
3. Successful completion
If every statement succeeds, the engine issues COMMIT before continuing with the next pipeline step.
See Transactional writes for a complete example.