Skip to main content

UnitOfWork

@forge/monorepo


@forge/monorepo / backend/src / UnitOfWork

Interface: UnitOfWork

Defined in: backend/src/persistence/index.ts:1770

Neutral unit of work, so a transaction-dependent workflow does not hardcode a database. Adapters that cannot provide transactions must not advertise the capability — startup validation fails loudly instead of degrading silently.

Methods

run()

run<T>(fn): Promise<T>

Defined in: backend/src/persistence/index.ts:1771

Type Parameters

T

T

Parameters

fn

() => Promise<T>

Returns

Promise<T>