import { ConditionFunction } from '../../condition' import { KeyVal, ResultSet, TableInfo } from '../../types' export declare enum DialectKind { READ = 0, SINGLE = 1, COUNT = 2, ANY = 3, WRITE = 4, JOIN = 5 } export interface IDialectBase extends Promise { sql: string } export declare class DialectBase< M, R = M[] | M | ResultSet | undefined | number | boolean > implements IDialectBase { sql: string; [Symbol.toStringTag]: 'Promise' protected info: TableInfo protected kind: DialectKind protected aliases?: KeyVal> protected map?: any private res private rej private readonly promise constructor(info: TableInfo) then( resolve?: | ((value: R) => TResult1 | PromiseLike) | null | undefined, reject?: | ((reason: any) => TResult2 | PromiseLike) | null | undefined ): Promise catch( onRejected?: (reason: any) => PromiseLike ): Promise resolve(value?: R | PromiseLike): void reject(reason?: any): void /** * Build SELECT sql from function. * @param fn Fields selection function. eg: p => p.foo or p => [ p.foo, p.bar ]. */ protected _select(fn: (k: M) => void): string /** * Build selected fields for SELECT statement. * @param fields selected fields. */ protected _buildSelectFields(fields: string[]): string /** * Build SQL statement from condition function. * @param fn Condition function. */ protected _condSql(fn: ConditionFunction): string /** * Map raw entity result to actual entity type. * @param raw Raw entity result (from query result). */ protected _mapResult(raw: T): T | undefined protected _mapResultWithAlias( raw: T, aliases: KeyVal> ): T | undefined /** * Execute SQL statement. * @param sql SQL statement. */ protected _exec(sql: string): Promise /** * Execute SQL statement as single query that returns single entity object. * @param sql SQL statement. */ protected _single(sql: string): Promise /** * Execute SQL statement as normal query that returns list of entity object. * @param sql SQL statement. */ protected _query( sql: string, aliases?: KeyVal>, map?: TResult ): Promise /** * Execute SQL statement as count query that returns the number data. * @param sql SQL statement. */ protected _count(sql: string): Promise /** * Execute SQL statement as count query and returns true if data number is found otherwise false. * @param sql SQL statement. */ protected _any(sql: string): Promise }