Function: atomically()
atomically<
T>(__namedParameters):Promise<T>
Defined in: atomically.ts:77
Runs fn as one transaction: every query inside it commits together, or
none does, without a transaction option threaded through each call.
Built on Sequelize's implicit transactions (Sequelize.useCLS), backed by
AsyncLocalStorage. A nested call joins the transaction already open rather
than opening a second one, so a function that is atomic on its own stays
atomic when composed into a larger write.
CLS is enabled process-wide on the first call, which means every managed
sequelize.transaction(fn) from then on also propagates implicitly.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
__namedParameters | AtomicallyOptions<T> |
Returns
Promise<T>