# RawClient.$transaction() method · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.rawclient._transaction/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 1.0.1 — generated reference, not hand-written

Run `fn` inside a transaction.

**Signature:**

```typescript
$transaction<T>(fn: (tx: RawExecutor) => Promise<T>): Promise<T>;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| fn | (tx: [RawExecutor](https://imqueue.org/api/pg-prisma/latest/pg-prisma.rawexecutor/)) => Promise<T> |  |


**Returns:**

Promise<T>

## Remarks

[installChangeTriggers()](https://imqueue.org/api/pg-prisma/latest/pg-prisma.installchangetriggers/) needs this so the whole reconciliation — the function, the added triggers and the dropped ones — either lands or does not.

