function getDrizzleTransaction
Since 0.2.0
getDrizzleTransaction<TDatabase extends object>(
unitOfWork: IUnitOfWork,
): DrizzleTransaction<TDatabase>

Returns Drizzle's callback-scoped transaction object for a Unit of Work.

Type Parameters

TDatabase extends object

Exact application Drizzle database type

Parameters

unitOfWork: IUnitOfWork

Unit of Work created for the active transaction

Opaque configuration supplied to this plugin instance

Return Type

The native callback-scoped transaction object

Throws

Error

If the Unit of Work, adapter, configuration, or runtime scope does not match

Usage

import { getDrizzleTransaction } from "database-plugin/src/index.ts";