UNPKG

database-proxy

Version:

Through a set of access control rules configuration database access to realize the client directly access the database via HTTP.

36 lines 1.74 kB
/// <reference types="node" /> import { AccessorInterface, ReadResult, UpdateResult, AddResult, RemoveResult, CountResult } from './accessor'; import { Params } from '../types'; import { Pool } from 'mysql2/promise'; import { ConnectionOptions } from 'mysql2'; import { LoggerInterface } from '../logger'; import { EventEmitter } from 'events'; /** * Mysql Accessor */ export declare class MysqlAccessor implements AccessorInterface { readonly type: string; readonly db_name: string; readonly options: ConnectionOptions; readonly pool: Pool; private _logger; readonly _event: EventEmitter; get logger(): LoggerInterface; setLogger(logger: LoggerInterface): void; get conn(): Pool; constructor(options?: ConnectionOptions); emit(event: string | symbol, ...args: any[]): boolean; once(event: string | symbol, listener: (...args: any[]) => void): void; removeAllListeners(event?: string | symbol): void; on(event: string | symbol, listener: (...args: any[]) => void): void; off(event: string | symbol, listener: (...args: any[]) => void): void; close(): Promise<void>; execute(params: Params): Promise<ReadResult | UpdateResult | AddResult | RemoveResult | CountResult | never>; get(collection: string, query: any): Promise<any>; protected read(_collection: string, params: Params): Promise<ReadResult>; protected update(_collection: string, params: Params): Promise<UpdateResult>; protected add(_collection: string, params: Params): Promise<AddResult>; protected remove(_collection: string, params: Params): Promise<RemoveResult>; protected count(_collection: string, params: Params): Promise<CountResult>; } //# sourceMappingURL=mysql.d.ts.map