Skip to content

Commit 12c6994

Browse files
committed
Merge branch 'master' into bmc/fix/2013
2 parents 4ce357f + e6e3692 commit 12c6994

300 files changed

Lines changed: 10799 additions & 4728 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM node:12
6+
FROM node:22
77

88
# Avoid warnings by switching to noninteractive
99
ENV DEBIAN_FRONTEND=noninteractive
@@ -16,9 +16,11 @@ ARG USERNAME=node
1616
ARG USER_UID=1000
1717
ARG USER_GID=$USER_UID
1818

19+
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
20+
1921
# Configure apt and install packages
2022
RUN apt-get update \
21-
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
23+
&& apt-get -y install --no-install-recommends dialog 2>&1 \
2224
#
2325
# Verify git and needed tools are installed
2426
&& apt-get -y install git iproute2 procps \
@@ -33,6 +35,7 @@ RUN apt-get update \
3335
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
3436
&& apt-get update \
3537
&& apt-get -y install --no-install-recommends yarn tmux locales postgresql \
38+
&& apt-get install libpq-dev python3 g++ make \
3639
#
3740
# Install eslint globally
3841
&& npm install -g eslint \
@@ -47,7 +50,6 @@ RUN apt-get update \
4750
&& apt-get install -y sudo \
4851
&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
4952
&& chmod 0440 /etc/sudoers.d/$USERNAME \
50-
#
5153
# Clean up
5254
&& apt-get autoremove -y \
5355
&& apt-get clean -y \

.devcontainer/devcontainer.json

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
11
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
22
{
3-
"name": "Node.js 12 & Postgres",
3+
"name": "Node.js 20 & Postgres",
44
"dockerComposeFile": "docker-compose.yml",
55
"service": "web",
66
"workspaceFolder": "/workspace",
7-
8-
// Use 'settings' to set *default* container specific settings.json values on container create.
9-
// You can edit these settings after create using File > Preferences > Settings > Remote.
10-
"settings": {
11-
"terminal.integrated.shell.linux": "/bin/bash"
12-
},
13-
14-
// Uncomment the next line if you want start specific services in your Docker Compose config.
15-
// "runServices": [],
16-
17-
// Uncomment the line below if you want to keep your containers running after VS Code shuts down.
18-
// "shutdownAction": "none",
19-
20-
// Uncomment the next line to run commands after the container is created.
21-
// "postCreateCommand": "npm install",
22-
23-
// Uncomment the next line to have VS Code connect as an existing non-root user in the container. See
24-
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist.
25-
// "remoteUser": "node",
26-
277
// Add the IDs of extensions you want installed when the container is created in the array below.
28-
"extensions": [
29-
"dbaeumer.vscode-eslint"
30-
]
31-
}
8+
"customizations":{
9+
"vscode": {
10+
"extensions": ["dbaeumer.vscode-eslint"],
11+
"settings": {
12+
"terminal.integrated.shell.linux": "/bin/bash"
13+
}
14+
}
15+
}
16+
}

.devcontainer/docker-compose.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
version: '3'
6+
version: '3.9'
77
services:
88
web:
99
# Uncomment the next line to use a non-root user for all processes. You can also
@@ -32,16 +32,21 @@ services:
3232
# Overrides default command so things don't shut down after the process ends.
3333
command: sleep infinity
3434

35-
links:
35+
depends_on:
3636
- db
3737

38+
links:
39+
- db:db
40+
3841
db:
39-
image: postgres
42+
image: postgres:14
4043
restart: unless-stopped
4144
ports:
4245
- 5432:5432
46+
command: postgres -c password_encryption=md5
4347
environment:
48+
POSTGRES_HOST_AUTH_METHOD: trust
49+
POSTGRES_INITDB_ARGS: "--auth-local=md5"
4450
POSTGRES_PASSWORD: pass
4551
POSTGRES_USER: user
4652
POSTGRES_DB: data
47-

.eslintrc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"plugins": ["prettier"],
2+
"plugins": ["@typescript-eslint", "prettier"],
33
"parser": "@typescript-eslint/parser",
4-
"extends": ["plugin:prettier/recommended", "prettier"],
4+
"extends": ["eslint:recommended", "plugin:prettier/recommended", "prettier"],
55
"ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*", "packages/pg-query-stream/dist/**/*"],
66
"parserOptions": {
77
"ecmaVersion": 2017,
@@ -11,5 +11,25 @@
1111
"node": true,
1212
"es6": true,
1313
"mocha": true
14-
}
14+
},
15+
"rules": {
16+
"@typescript-eslint/no-unused-vars": ["error", {
17+
"args": "none",
18+
"varsIgnorePattern": "^_$"
19+
}],
20+
"no-unused-vars": ["error", {
21+
"args": "none",
22+
"varsIgnorePattern": "^_$"
23+
}],
24+
"no-var": "error",
25+
"prefer-const": "error"
26+
},
27+
"overrides": [
28+
{
29+
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
30+
"rules": {
31+
"no-undef": "off"
32+
}
33+
}
34+
]
1535
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/packages/pg-connection-string @hjr3

.github/workflows/ci.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,70 @@ permissions:
77

88
jobs:
99
lint:
10+
timeout-minutes: 5
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1314
with:
1415
persist-credentials: false
1516
- name: Setup node
16-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@v4
1718
with:
1819
node-version: 18
1920
cache: yarn
20-
- run: yarn install
21+
- run: yarn install --frozen-lockfile
2122
- run: yarn lint
2223
build:
24+
timeout-minutes: 15
2325
needs: lint
24-
runs-on: ubuntu-latest
2526
services:
2627
postgres:
27-
image: postgres:11
28+
image: ghcr.io/railwayapp-templates/postgres-ssl
2829
env:
2930
POSTGRES_USER: postgres
3031
POSTGRES_PASSWORD: postgres
31-
POSTGRES_DB: ci_db_test
3232
POSTGRES_HOST_AUTH_METHOD: 'md5'
33+
POSTGRES_DB: ci_db_test
3334
ports:
3435
- 5432:5432
3536
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
3637
strategy:
38+
fail-fast: false
3739
matrix:
38-
node: ['10', '12', '14', '16', '18']
39-
os: [ubuntu-latest, windows-latest, macos-latest]
40-
name: Node.js ${{ matrix.node }} (${{ matrix.os }})
40+
node:
41+
- '16'
42+
- '18'
43+
- '20'
44+
- '22'
45+
- '24'
46+
- '25'
47+
os:
48+
- ubuntu-latest
49+
name: Node.js ${{ matrix.node }}
50+
runs-on: ubuntu-latest
4151
env:
42-
PGUSER: postgres
43-
PGHOST: localhost
44-
PGPASSWORD: postgres
45-
PGDATABASE: ci_db_test
46-
PGTESTNOSSL: 'true'
47-
SCRAM_TEST_PGUSER: scram_test
48-
SCRAM_TEST_PGPASSWORD: test4scram
52+
PGUSER: postgres
53+
PGPASSWORD: postgres
54+
PGHOST: localhost
55+
PGDATABASE: ci_db_test
56+
PGTESTNOSSL: 'true'
57+
SCRAM_TEST_PGUSER: scram_test
58+
SCRAM_TEST_PGPASSWORD: test4scram
4959
steps:
60+
- name: Show OS
61+
run: |
62+
uname -a
5063
- run: |
5164
psql \
5265
-c "SET password_encryption = 'scram-sha-256'" \
5366
-c "CREATE ROLE scram_test LOGIN PASSWORD 'test4scram'"
54-
- uses: actions/checkout@v3
67+
- uses: actions/checkout@v4
5568
with:
5669
persist-credentials: false
5770
- name: Setup node
58-
uses: actions/setup-node@v3
71+
uses: actions/setup-node@v4
5972
with:
6073
node-version: ${{ matrix.node }}
6174
cache: yarn
62-
- run: yarn install
63-
# TODO(bmc): get ssl tests working in ci
75+
- run: yarn install --frozen-lockfile
6476
- run: yarn test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ package-lock.json
77
*.swp
88
dist
99
.DS_Store
10+
/.eslintcache
1011
.vscode/
1112
manually-test-on-heroku.js

.travis.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ For richer information consult the commit log on github with referenced pull req
44

55
We do not include break-fix version release in this file.
66

7+
## pg@8.18.0
8+
9+
- [Return the client instance](https://github.com/brianc/node-postgres/pull/3564) as the result of calling `connect` (previously it was `void`).
10+
11+
## pg@8.17.0
12+
13+
- Throw correct error if database URL parsing [fails](https://github.com/brianc/node-postgres/issues/3513).
14+
15+
## pg@8.16.0
16+
17+
- Add support for [min connection pool size](https://github.com/brianc/node-postgres/pull/3438).
18+
19+
## pg@8.15.0
20+
21+
- Add support for [esm](https://github.com/brianc/node-postgres/pull/3423) importing. CommonJS importing is still also supported.
22+
23+
## pg@8.14.0
24+
25+
- Add support from SCRAM-SAH-256-PLUS i.e. [channel binding](https://github.com/brianc/node-postgres/pull/3356).
26+
27+
## pg@8.13.0
28+
29+
- Add ability to specify query timeout on [per-query basis](https://github.com/brianc/node-postgres/pull/3074).
30+
31+
## pg@8.12.0
32+
33+
- Add `queryMode` config option to [force use of the extended query protocol](https://github.com/brianc/node-postgres/pull/3214) on queries without any parameters.
34+
735
## pg-pool@8.10.0
836

937
- Emit `release` event when client is returned to [the pool](https://github.com/brianc/node-postgres/pull/2845).
@@ -64,7 +92,7 @@ We do not include break-fix version release in this file.
6492

6593
### pg@8.2.0
6694

67-
- Switch internal protocol parser & serializer to [pg-protocol](https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol). The change is backwards compatible but results in a significant performance improvement across the board, with some queries as much as 50% faster. This is the first work to land in an on-going performance improvment initiative I'm working on. Stay tuned as things are set to get much faster still! :rocket:
95+
- Switch internal protocol parser & serializer to [pg-protocol](https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol). The change is backwards compatible but results in a significant performance improvement across the board, with some queries as much as 50% faster. This is the first work to land in an on-going performance improvement initiative I'm working on. Stay tuned as things are set to get much faster still! :rocket:
6896

6997
### pg-cursor@2.2.0
7098

0 commit comments

Comments
 (0)