pg-connection-string
Advanced tools
Comparing version
@@ -10,2 +10,9 @@ import { ClientConfig } from 'pg' | ||
interface SSLConfig { | ||
ca?: string | ||
cert?: string | null | ||
key?: string | ||
rejectUnauthorized?: boolean | ||
} | ||
export interface ConnectionOptions { | ||
@@ -18,3 +25,3 @@ host: string | null | ||
client_encoding?: string | ||
ssl?: boolean | string | ||
ssl?: boolean | string | SSLConfig | ||
@@ -24,2 +31,6 @@ application_name?: string | ||
options?: string | ||
keepalives?: number | ||
// We allow any other options to be passed through | ||
[key: string]: unknown | ||
} | ||
@@ -26,0 +37,0 @@ |
@@ -172,8 +172,4 @@ 'use strict' | ||
} | ||
// else path is taken. multiple tests produce a sslConfig that is an object | ||
// and we can console.log to see that we take this path | ||
// | ||
// see https://github.com/istanbuljs/babel-plugin-istanbul/issues/186#issuecomment-1137765139 | ||
// istanbul ignore else | ||
else if (typeof sslConfig === 'object') { | ||
if (typeof sslConfig === 'object') { | ||
c[key] = toConnectionOptions(sslConfig) | ||
@@ -180,0 +176,0 @@ } |
{ | ||
"name": "pg-connection-string", | ||
"version": "2.8.5", | ||
"version": "2.9.0", | ||
"description": "Functions for dealing with a PostgresSQL connection string", | ||
@@ -16,5 +16,4 @@ "main": "./index.js", | ||
"scripts": { | ||
"test": "istanbul cover _mocha && npm run check-coverage", | ||
"check-coverage": "istanbul check-coverage --statements 100 --branches 100 --lines 100 --functions 100", | ||
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls" | ||
"test": "nyc --reporter=lcov mocha && npm run check-coverage", | ||
"check-coverage": "nyc check-coverage --statements 100 --branches 100 --lines 100 --functions 100" | ||
}, | ||
@@ -39,6 +38,10 @@ "repository": { | ||
"devDependencies": { | ||
"@types/pg": "^8.12.0", | ||
"chai": "^4.1.1", | ||
"coveralls": "^3.0.4", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^10.5.2" | ||
"mocha": "^10.5.2", | ||
"nyc": "^15", | ||
"tsx": "^4.19.4", | ||
"typescript": "^4.0.3" | ||
}, | ||
@@ -50,3 +53,3 @@ "files": [ | ||
], | ||
"gitHead": "56e286257724783681f8830b2faa7d407b6563e7" | ||
"gitHead": "abff18d6f918c975e8b3dfebc0de3b811ae64bcb" | ||
} |
@@ -6,5 +6,2 @@ pg-connection-string | ||
[](https://travis-ci.org/iceddev/pg-connection-string) | ||
[](https://coveralls.io/github/iceddev/pg-connection-string?branch=master) | ||
Functions for dealing with a PostgresSQL connection string | ||
@@ -19,5 +16,5 @@ | ||
```js | ||
var parse = require('pg-connection-string').parse; | ||
const parse = require('pg-connection-string').parse; | ||
var config = parse('postgres://someuser:somepassword@somehost:381/somedatabase') | ||
const config = parse('postgres://someuser:somepassword@somehost:381/somedatabase') | ||
``` | ||
@@ -24,0 +21,0 @@ |
214
1.9%14706
-2.43%8
100%106
-2.75%