import { Pool, QueryResult } from 'pg';
import { DatasourceService } from '../../datasource.service';
import { Driver } from '../driver';
import { QueryRunnerInterface } from '../query-runner.interface';
import { PostgresConnectionOptions } from './postgres-connection.options';
export declare class PostgresConnectionDriver implements Driver {
    database: string;
    options: PostgresConnectionOptions;
    postgres: any;
    connection: DatasourceService;
    /**
     * Pool for master database.
     */
    master?: Pool;
    /**
     * Version of Postgres. Requires a SQL query to the DB, so it is not always set
     */
    version?: string;
    /**
     * We store all created query runners because we need to release them.
     */
    connectedQueryRunners: Array<QueryRunnerInterface>;
    constructor(connection: DatasourceService);
    protected loadDependencies(): void;
    connect(): Promise<void>;
    afterConnect(): Promise<void>;
    disconnect(): Promise<void>;
    protected createPool(options: PostgresConnectionOptions): Promise<Pool>;
    /**
     * Obtains a new database connection to a master server.
     * Used for replication.
     * If replication is not setup then returns default connection's database connection.
     */
    obtainMasterConnection(): Promise<[
        unknown,
        () => Promise<void> | void
    ]>;
    /**
     * Executes given query.
     */
    protected executeQuery(connection: any, query: string): Promise<QueryResult>;
    createQueryRunner(): QueryRunnerInterface;
}
