Skip to content

Commit ee489bf

Browse files
committed
fix(pg-connection-string): update TypeScript definitions
1 parent 7a00938 commit ee489bf

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packages/pg-connection-string/index.d.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ClientConfig } from 'pg'
1+
//import { ClientConfig } from 'pg'
2+
import { ClientConfig as PgClientConfig } from 'pg'
23

34
export function parse(connectionString: string, options?: Options): ConnectionOptions
45

@@ -7,18 +8,36 @@ export interface Options {
78
useLibpqCompat?: boolean
89
}
910

11+
interface SSLConfig {
12+
ca?: string
13+
cert?: string | null
14+
key?: string
15+
rejectUnauthorized?: boolean
16+
}
17+
1018
export interface ConnectionOptions {
1119
host: string | null
1220
password?: string
1321
user?: string
1422
port?: string | null
1523
database: string | null | undefined
1624
client_encoding?: string
17-
ssl?: boolean | string
25+
ssl?: boolean | string | SSLConfig
1826

1927
application_name?: string
2028
fallback_application_name?: string
2129
options?: string
30+
keepalives?: number
31+
32+
// We allow any other options to be passed through
33+
[key: string]: unknown
34+
}
35+
36+
// FIXME: remove this when https://github.com/DefinitelyTyped/DefinitelyTyped/pull/72576 lands
37+
export interface ClientConfig extends PgClientConfig {
38+
fallback_application_name?: string
39+
client_encoding?: string
40+
options?: string
2241
}
2342

2443
export function toClientConfig(config: ConnectionOptions): ClientConfig

0 commit comments

Comments
 (0)