UNPKG

@eggjs/dal-runtime

Version:
24 lines (23 loc) 747 B
import type { RDSClientOptions } from '@eggjs/rds'; import Base from 'sdk-base'; import { Logger } from '@eggjs/tegg-types'; export interface DataSourceOptions extends RDSClientOptions { name: string; initSql?: string; forkDb?: boolean; initRetryTimes?: number; logger?: Logger; } export declare class MysqlDataSource extends Base { #private; private client; private readonly initSql; readonly name: string; readonly timezone?: string; readonly rdsOptions: RDSClientOptions; readonly forkDb?: boolean; constructor(options: DataSourceOptions); protected _init(): Promise<void>; query<T = any>(sql: string): Promise<T>; beginTransactionScope<T>(scope: () => Promise<T>): Promise<T>; }