Skip to content

Commit f968d4f

Browse files
committed
Resolve merge conflict
2 parents cfd0019 + e30b41d commit f968d4f

File tree

168 files changed

+2672
-1963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2672
-1963
lines changed

.eslintrc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
},
1515
"rules": {
1616
"@typescript-eslint/no-unused-vars": ["error", {
17-
"args": "none"
17+
"args": "none",
18+
"varsIgnorePattern": "^_$"
1819
}],
19-
"no-unused-vars": "off"
20+
"no-unused-vars": ["error", {
21+
"args": "none",
22+
"varsIgnorePattern": "^_$"
23+
}],
24+
"no-var": "error",
25+
"prefer-const": "error"
2026
},
2127
"overrides": [
2228
{

docs/pages/apis/utilities.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Alert } from '/components/alert.tsx'
99
Escapes a string as a [SQL identifier](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS).
1010

1111
```js
12-
const { escapeIdentifier } = require('pg')
12+
import { escapeIdentifier } from 'pg';
1313
const escapedIdentifier = escapeIdentifier('FooIdentifier')
1414
console.log(escapedIdentifier) // '"FooIdentifier"'
1515
```
@@ -27,7 +27,7 @@ console.log(escapedIdentifier) // '"FooIdentifier"'
2727
Escapes a string as a [SQL literal](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS).
2828

2929
```js
30-
const { escapeLiteral } = require('pg')
30+
import { escapeLiteral } from 'pg';
3131
const escapedLiteral = escapeLiteral("hello 'world'")
3232
console.log(escapedLiteral) // "'hello ''world'''"
3333
```

docs/pages/features/connecting.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ const signerOptions = {
101101
username: 'api-user',
102102
}
103103

104-
const signer = new RDS.Signer()
104+
const signer = new RDS.Signer(signerOptions)
105105

106-
const getPassword = () => signer.getAuthToken(signerOptions)
106+
const getPassword = () => signer.getAuthToken()
107107

108108
const pool = new Pool({
109109
user: signerOptions.username,

docs/pages/guides/upgrading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pg.end()
5050
// new way, available since 6.0.0:
5151

5252
// create a pool
53-
var pool = new pg.Pool()
53+
const pool = new pg.Pool()
5454

5555
// connection using created pool
5656
pool.connect(function (err, client, done) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@typescript-eslint/eslint-plugin": "^7.0.0",
2424
"@typescript-eslint/parser": "^6.17.0",
2525
"eslint": "^8.56.0",
26-
"eslint-config-prettier": "^9.1.0",
26+
"eslint-config-prettier": "^10.1.2",
2727
"eslint-plugin-node": "^11.1.0",
2828
"eslint-plugin-prettier": "^5.1.2",
2929
"lerna": "^3.19.0",

packages/pg-connection-string/.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ lib-cov
1212

1313
# Coverage directory used by tools like istanbul
1414
coverage
15+
.nyc_output
1516

1617
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1718
.grunt
@@ -23,4 +24,7 @@ build/Release
2324
# Deployed apps should consider commenting this line out:
2425
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
2526
node_modules
26-
package-lock.json
27+
package-lock.json
28+
29+
# TypeScript output directory
30+
dist
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extension": ["js", "ts"],
3+
"require": "tsx"
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"processes":{"417f2d4c-eaf2-4112-952c-a801df7fb93d":{"parent":null,"children":[]}},"files":{"/Users/bmc/src/node-postgres/packages/pg-connection-string/index.js":["417f2d4c-eaf2-4112-952c-a801df7fb93d"]},"externalIds":{}}

packages/pg-connection-string/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ pg-connection-string
33

44
[![NPM](https://nodei.co/npm/pg-connection-string.png?compact=true)](https://nodei.co/npm/pg-connection-string/)
55

6-
[![Build Status](https://travis-ci.org/iceddev/pg-connection-string.svg?branch=master)](https://travis-ci.org/iceddev/pg-connection-string)
7-
[![Coverage Status](https://coveralls.io/repos/github/iceddev/pg-connection-string/badge.svg?branch=master)](https://coveralls.io/github/iceddev/pg-connection-string?branch=master)
8-
96
Functions for dealing with a PostgresSQL connection string
107

118
`parse` method taken from [node-postgres](https://github.com/brianc/node-postgres.git)
@@ -15,9 +12,9 @@ MIT License
1512
## Usage
1613

1714
```js
18-
var parse = require('pg-connection-string').parse;
15+
const parse = require('pg-connection-string').parse;
1916

20-
var config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')
17+
const config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')
2118
```
2219

2320
The resulting config contains a subset of the following properties:

packages/pg-connection-string/index.d.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,29 @@ export interface Options {
77
useLibpqCompat?: boolean
88
}
99

10+
interface SSLConfig {
11+
ca?: string
12+
cert?: string | null
13+
key?: string
14+
rejectUnauthorized?: boolean
15+
}
16+
1017
export interface ConnectionOptions {
1118
host: string | null
1219
password?: string
1320
user?: string
1421
port?: string | null
1522
database: string | null | undefined
1623
client_encoding?: string
17-
ssl?: boolean | string
24+
ssl?: boolean | string | SSLConfig
1825

1926
application_name?: string
2027
fallback_application_name?: string
2128
options?: string
29+
keepalives?: number
30+
31+
// We allow any other options to be passed through
32+
[key: string]: unknown
2233
}
2334

2435
export function toClientConfig(config: ConnectionOptions): ClientConfig

0 commit comments

Comments
 (0)