File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
packages/pg-connection-string Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1
- import { ClientConfig } from 'pg'
1
+ //import { ClientConfig } from 'pg'
2
+ import { ClientConfig as PgClientConfig } from 'pg'
2
3
3
4
export function parse ( connectionString : string , options ?: Options ) : ConnectionOptions
4
5
@@ -7,18 +8,36 @@ export interface Options {
7
8
useLibpqCompat ?: boolean
8
9
}
9
10
11
+ interface SSLConfig {
12
+ ca ?: string
13
+ cert ?: string | null
14
+ key ?: string
15
+ rejectUnauthorized ?: boolean
16
+ }
17
+
10
18
export interface ConnectionOptions {
11
19
host : string | null
12
20
password ?: string
13
21
user ?: string
14
22
port ?: string | null
15
23
database : string | null | undefined
16
24
client_encoding ?: string
17
- ssl ?: boolean | string
25
+ ssl ?: boolean | string | SSLConfig
18
26
19
27
application_name ?: string
20
28
fallback_application_name ?: string
21
29
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
22
41
}
23
42
24
43
export function toClientConfig ( config : ConnectionOptions ) : ClientConfig
You can’t perform that action at this time.
0 commit comments