index.d.ts 911 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { ClientConfig } from 'pg'
  2. export function parse(connectionString: string, options?: Options): ConnectionOptions
  3. export interface Options {
  4. // Use libpq semantics when interpreting the connection string
  5. useLibpqCompat?: boolean
  6. }
  7. interface SSLConfig {
  8. ca?: string
  9. cert?: string | null
  10. key?: string
  11. rejectUnauthorized?: boolean
  12. }
  13. export interface ConnectionOptions {
  14. host: string | null
  15. password?: string
  16. user?: string
  17. port?: string | null
  18. database: string | null | undefined
  19. client_encoding?: string
  20. ssl?: boolean | string | SSLConfig
  21. application_name?: string
  22. fallback_application_name?: string
  23. options?: string
  24. keepalives?: number
  25. // We allow any other options to be passed through
  26. [key: string]: unknown
  27. }
  28. export function toClientConfig(config: ConnectionOptions): ClientConfig
  29. export function parseIntoClientConfig(connectionString: string): ClientConfig