-
Notifications
You must be signed in to change notification settings - Fork 0
Transaction
Christoph Herrmann edited this page Jun 14, 2019
·
6 revisions
It's possible to wrap multiple queries into a transaction which will be started and at the end committed. If an error is thrown, the transaction will be rollbacked.
await sql.transaction(async () => {
const id = await sql.insert(
'users',
{ name: 'Sharaal', email: '[email protected]' }
)
await sql.insert('audits', { action: 'USER_CREATED', id })
})
Found a bug or missing a feature? -> Create a new Issue
Found a security issue? -> Look at the Security Policy
Having questions, want to give feedback or talk to me? -> E-Mail me [email protected]