import { Client } from 'pg'; import { Factory } from 'generic-pool'; import { DBClient, DBClientConfig } from '../db/DBClient'; import { DBTransaction } from '../db/DBTransaction'; import { ConnectionConfig, ConnectionPool } from '../db/ConnectionPool'; /** * CONFIGURATION OBJECTS */ export interface PostgresConnectionConfig extends ConnectionConfig { /** * number of milliseconds before a query will time out default is no timeout */ statement_timeout?: number; /** * The hostname of the database you are connecting to. (Default: localhost) */ host: string; /** * The port number to connect to. (Default: 3306) */ port?: number; /** * Name of the database to connect to */ database: string; /** * User used to connect */ user: string; /** * Password used to authenticate on connection */ password: string; /** * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10 seconds) */ connectTimeout?: number; /** * The source IP address to use for TCP connection */ localAddress?: string; /** * The path to a unix domain socket to connect to. When used host and port are ignored */ socketPath?: string; /** * The timezone used to store local dates. (Default: 'local') */ timezone?: string; /** * object with ssl parameters or a string containing name of ssl profile */ ssl?: any; /** * The character set to use in the connection */ charset?: string; } export interface PostgresClientConfiguration extends DBClientConfig { } export declare class PostgresTransaction extends DBTransaction { protected runQueryInConnection(sql: string, bindsArr: Array): Promise; } /** * A MySQL client you can use to execute queries against MySQL */ export declare class PostgresClient extends DBClient { initialise(): Promise; getConnectionFactory(name: string, connectionConfig: PostgresConnectionConfig): Factory; getNewDBTransaction(readonly: boolean, connectionPool: ConnectionPool): PostgresTransaction; getPingQuery(): string; getDefaultConnectionConfig(): PostgresConnectionConfig; }