SqlRunner.transaction() method

Run fn inside a transaction, with every query it reaches joining it.

Signature:

transaction<Result>(fn: () => Promise<Result>): Promise<Result>;

Parameters

Parameter

Type

Description

fn

() => Promise<Result>

Work to run in the transaction.

Returns:

Promise<Result>

Whatever fn resolves to.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.