UNPKG

@mwcp/kmore

Version:

midway component for knex, supports declarative transaction and OpenTelemetry

26 lines 1.21 kB
import { IMidwayContainer } from '@midwayjs/core'; import { TraceScopeType, TraceService } from '@mwcp/otel'; import { Application, Context } from '@mwcp/share'; import type { ExceptionHookOptions, Kmore, KmoreTransaction } from 'kmore'; import { TrxStatusService } from '../trx-status.service.js'; import { DbConfig } from '../types.js'; import { DbHookBuilder } from './db-hook.builder.js'; import { DbHookTrx } from './db-hook.trx.js'; export declare class DbHook<SourceName extends string = string> { private readonly sourceConfig; readonly app: Application; readonly applicationContext: IMidwayContainer; readonly appDir: string; readonly baseDir: string; readonly trxStatusSvc: TrxStatusService; readonly traceService: TraceService; readonly dbHookBuilder: DbHookBuilder; readonly dbHookTrx: DbHookTrx; getDbConfigByDbId(dbId: SourceName): DbConfig | undefined; getWebContext(): Context | undefined; getWebContextThenApp(): Context | Application; getTraceScopeByTrx(transaction: KmoreTransaction): TraceScopeType; createProxy(db: Kmore): void; exceptionHook(options: ExceptionHookOptions): Promise<never>; } //# sourceMappingURL=db-hook.d.ts.map