main
|
Last change
on this file since 6c7cfa6 was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago |
|
Project Handcraft Marketplace
|
-
Property mode
set to
100644
|
|
File size:
952 bytes
|
| Line | |
|---|
| 1 | import { ClientConfig } from 'pg'
|
|---|
| 2 |
|
|---|
| 3 | export function parse(connectionString: string, options?: Options): ConnectionOptions
|
|---|
| 4 |
|
|---|
| 5 | export interface Options {
|
|---|
| 6 | // Use libpq semantics when interpreting the connection string
|
|---|
| 7 | useLibpqCompat?: boolean
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | interface SSLConfig {
|
|---|
| 11 | ca?: string
|
|---|
| 12 | cert?: string | null
|
|---|
| 13 | key?: string
|
|---|
| 14 | rejectUnauthorized?: boolean
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | export interface ConnectionOptions {
|
|---|
| 18 | host: string | null
|
|---|
| 19 | password?: string
|
|---|
| 20 | user?: string
|
|---|
| 21 | port?: string | null
|
|---|
| 22 | database: string | null | undefined
|
|---|
| 23 | client_encoding?: string
|
|---|
| 24 | ssl?: boolean | string | SSLConfig
|
|---|
| 25 | sslnegotiation?: 'postgres' | 'direct'
|
|---|
| 26 |
|
|---|
| 27 | application_name?: string
|
|---|
| 28 | fallback_application_name?: string
|
|---|
| 29 | options?: string
|
|---|
| 30 | keepalives?: number
|
|---|
| 31 |
|
|---|
| 32 | // We allow any other options to be passed through
|
|---|
| 33 | [key: string]: unknown
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | export function toClientConfig(config: ConnectionOptions): ClientConfig
|
|---|
| 37 | export function parseIntoClientConfig(connectionString: string): ClientConfig
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.