Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3367 Add interface for PG Connection object #3372

Merged
merged 5 commits into from Oct 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions types/index.d.ts
Expand Up @@ -1616,6 +1616,8 @@ declare namespace Knex {
| MySqlConnectionConfig
| MsSqlConnectionConfig
| OracleDbConnectionConfig
| PgConnectionConfig
| RedshiftConnectionConfig
| Sqlite3ConnectionConfig
| SocketConnectionConfig;
pool?: PoolConfig;
Expand Down Expand Up @@ -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;
Copy link
Contributor Author

@timorthi timorthi Jul 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured I'd sneak this in since the Redshift dialect uses the same driver.


/** Used with SQLite3 adapter */
interface Sqlite3ConnectionConfig {
filename: string;
Expand Down