import { getInformationSchema } from './information_schema'; import { Value } from 'sqlex'; export declare type Dialect = 'mysql' | 'postgres' | 'mssql' | 'oracle' | 'sqlite3'; export interface ConnectionInfo { dialect: Dialect; connection: { [key: string]: any; }; } export declare type Row = { [key: string]: Value; }; export declare class QueryCounter { total: number; } export declare type TransactionCallback = (connection: Connection) => Promise | void; export interface DialectEncoder { escape: (unsafe: any) => string; escapeId: (unsafe: string) => string; } export declare abstract class Connection implements DialectEncoder { dialect: Dialect; connection: any; name: string; queryCounter: QueryCounter; abstract query(sql: string, pk?: string): Promise; beginTransaction(): Promise; commit(): Promise; rollback(): Promise; abstract end(): Promise; abstract release(): any; abstract escape(s: string): string; abstract escapeId(name: string): string; transaction(callback: TransactionCallback): Promise; } export declare abstract class ConnectionPool implements DialectEncoder { dialect: Dialect; name: string; abstract getConnection(): Promise; abstract end(): Promise; abstract escape(s: string): string; abstract escapeId(name: string): string; } export declare function createConnectionPool(dialect: Dialect, connection: any): ConnectionPool; export declare function createConnection(dialect: string, connection: any): Connection; export { getInformationSchema };