Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/typeorm/src/index.ts>Transaction

Forked from https://github.com/typeorm/typeorm
Latest
function Transaction
import { Transaction } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/index.ts";

Wraps some method into the transaction.

Method result will return a promise if this decorator applied. All database operations in the wrapped method should be executed using entity managed passed as a first parameter into the wrapped method.

If you want to control at what position in your method parameters entity manager should be injected, then use @TransactionEntityManager() decorator.

If you want to use repositories instead of bare entity manager, then use @TransactionRepository() decorator.

Parameters

optional
connectionName: string

Returns

MethodDecorator

Parameters

optional
options: TransactionOptions

Returns

MethodDecorator