mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
Two new functions are introduced to make it easy for TypeScript users to use a PostgresSQL connection string with pg Client. Fixes #2280
21 lines
549 B
TypeScript
21 lines
549 B
TypeScript
import { ClientConfig } from 'pg'
|
|
|
|
export function parse(connectionString: string): ConnectionOptions
|
|
|
|
export interface ConnectionOptions {
|
|
host: string | null
|
|
password?: string
|
|
user?: string
|
|
port?: string | null
|
|
database: string | null | undefined
|
|
client_encoding?: string
|
|
ssl?: boolean | string
|
|
|
|
application_name?: string
|
|
fallback_application_name?: string
|
|
options?: string
|
|
}
|
|
|
|
export function toClientConfig(config: ConnectionOptions): ClientConfig
|
|
export function parseIntoClientConfig(connectionString: string): ClientConfig
|