#3367 Add interface for PG Connection object (#3372)

This commit is contained in:
Timothy Ng 2019-10-25 23:04:51 -07:00 committed by Igor Savin
parent 1c65562440
commit d806ec0c20

19
types/index.d.ts vendored
View File

@ -1616,6 +1616,8 @@ declare namespace Knex {
| MySqlConnectionConfig
| MsSqlConnectionConfig
| OracleDbConnectionConfig
| PgConnectionConfig
| RedshiftConnectionConfig
| Sqlite3ConnectionConfig
| SocketConnectionConfig;
pool?: PoolConfig;
@ -1755,6 +1757,23 @@ declare namespace Knex {
connectString?: string;
}
// Config object for pg: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pg/index.d.ts
interface PgConnectionConfig {
user?: string;
database?: string;
password?: string;
port?: number;
host?: string;
connectionString?: string;
keepAlive?: boolean;
stream?: stream.Duplex;
statement_timeout?: false | number;
connectionTimeoutMillis?: number;
keepAliveInitialDelayMillis?: number;
}
type RedshiftConnectionConfig = PgConnectionConfig;
/** Used with SQLite3 adapter */
interface Sqlite3ConnectionConfig {
filename: string;