method IUnitOfWork.getRepository
Since 0.1.0
IUnitOfWork.getRepository<Entity, Id extends EntityKey = string>(entity: string): IRepository<Entity, Id>

Get a transaction-scoped repository for the named entity.

Type Parameters

Entity

Entity shape

Id extends EntityKey = string

Primary key type

Parameters

entity: string

Entity name (e.g. 'User')

Return Type

Repository bound to the current transaction

Usage

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