Class: InsightsRepositories
Defined in: server/insights/repositories.ts:25
Holds the insights repositories and exposes a transaction() entry point.
Uses the ambient PRIMARY Prisma client (registered via
registerPrismaClient / initPrismaClient). The engine's read path may run
on an optional replica queryClient, but ALL writes — saved-report CRUD +
audit columns — go through this primary client. Repositories route their
handle through TransactionManager, so inside transaction(fn) every
this.tx.* call resolves to the active transaction automatically.
Constructors
Constructor
new InsightsRepositories(options?: InsightsRepositoriesOptions): InsightsRepositories;Defined in: server/insights/repositories.ts:31
Parameters
| Parameter | Type |
|---|---|
options | InsightsRepositoriesOptions |
Returns
InsightsRepositories
Properties
reportSchedules
readonly reportSchedules: ReportScheduleRepository;Defined in: server/insights/repositories.ts:29
savedReports
readonly savedReports: SavedReportsRepository;Defined in: server/insights/repositories.ts:28
Methods
transaction()
transaction<T>(fn: (repos: InsightsRepositories) => Promise<T>): Promise<T>;Defined in: server/insights/repositories.ts:38
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | (repos: InsightsRepositories) => Promise<T> |
Returns
Promise<T>