Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
dcb4257
docs: fix bug in transaction example (#3414)
lucaesposto Apr 1, 2025
a5d03a0
build(deps-dev): bump eslint-plugin-prettier from 5.1.2 to 5.2.5 (#3412)
dependabot[bot] Apr 1, 2025
a9fd34f
Revert "docs: fix bug in transaction example (#3414)"
charmander Apr 3, 2025
5a8b1a7
feat(pg-connection-string): ClientConfig helper functions
hjr3 Jan 17, 2024
9b51037
eslint: enable recommended ruleset (#3263)
alxndrsn Apr 12, 2025
d8fb2f9
test: Avoid silencing errors from idle timeout test’s child process (…
charmander Apr 13, 2025
81ec063
feat(pg-connection-string): get closer to libpq semantics for `sslmode`
pmalouin Apr 20, 2025
940479b
Add esm exports (#3423)
brianc Apr 22, 2025
60817cd
Update changelog
brianc Apr 22, 2025
9ec9e5f
Publish
brianc Apr 22, 2025
9cc7d8e
docs: add missing parameters on pg.Client Config (#3422)
hjr3 Apr 22, 2025
557716d
fix(pg-connection-string): export default from esm wrapper (#3425)
hjr3 Apr 22, 2025
fb25f7b
Publish
Apr 22, 2025
bbc84b2
pg-connection-string: fix 'parse' type signature
nektro Apr 23, 2025
2da196c
fix(exports): resolve issues with module imports and requires (#3428)
brenoepics Apr 23, 2025
e8280d5
Add tests for issues fixed in #3428 (#3432)
brianc Apr 23, 2025
ad3e603
Expose TypeOverrides in esm & cjs from root of package (#3433)
brianc Apr 23, 2025
6ab0c46
More tests & exports from pg-protocol (#3436)
brianc Apr 23, 2025
36fd0a6
Only allow publish from master
brianc Apr 23, 2025
2919f28
Manually advance patch versions to re-align with lerna
brianc Apr 23, 2025
56e2862
Publish
brianc Apr 23, 2025
0c1629b
Update docs - add ESM info
brianc Apr 23, 2025
39e134d
Make pg-cursor compatible with older versions of pg (#3440)
brianc Apr 24, 2025
81d875f
Publish
Apr 25, 2025
229de30
Remove circluar dep for test dependency - I think this is managed w l…
brianc Apr 25, 2025
ff40638
Support Min connection pool parameter #3009 (#3438)
htrajan Apr 25, 2025
7a00938
Update pool docs (#3442)
brianc Apr 25, 2025
9e7a5d9
Replace all usages of var with let / const - eslint auto applied (#3444)
brianc Apr 27, 2025
93aa1ba
chore: replace var with const in md files (#3446)
DavideViolante Apr 28, 2025
f528433
chore: minor eslint fixes, reenable no-unused vars (#3445)
DavideViolante Apr 28, 2025
264e30f
docs: require to import (#3448)
cesco69 Apr 29, 2025
980752c
Hard-pin 3rd party dependencies (#3450)
brianc Apr 29, 2025
2647f7e
Create README.md (#3451)
brianc May 1, 2025
52ec129
build(deps-dev): bump @cloudflare/vitest-pool-workers (#3456)
dependabot[bot] May 1, 2025
79351af
build(deps-dev): bump eslint-plugin-prettier from 5.2.5 to 5.2.6 (#3455)
dependabot[bot] May 1, 2025
9bfc967
build(deps-dev): bump eslint-config-prettier from 9.1.0 to 10.1.2 (#3…
dependabot[bot] May 1, 2025
6be857e
chore(pg-connection-string): use tsx for tests
hjr3 Apr 20, 2025
e30b41d
Update connecting.mdx (#3266)
maltewirz May 11, 2025
27f34c6
Bump libpq & nan version dep for node24 compat (#3462)
brianc May 12, 2025
e8fde07
chore: document keepAliveInitialDelayMillis option (#3460)
hjr3 May 12, 2025
e43d4b7
Update changelog
brianc May 12, 2025
abff18d
Publish
brianc May 12, 2025
a47c480
fix sslcompat remains
lorentzlasson May 14, 2025
26fa32c
Update theme.config.js (#3468)
brianc May 16, 2025
c9353ac
chore: fix typos in README (#3470)
noritaka1166 May 25, 2025
9cf2184
refactor: remove unused import & fix typos in docs (#3471)
noritaka1166 May 25, 2025
3e7bd2f
Change instanceof(Date) to util.types.isDate(Date) (#2862)
Srayman May 26, 2025
26ace0a
fix(pg-connection-string): remove .nyc_output
hjr3 May 26, 2025
411869d
pool.end() resolves before the last pool.query() (#3461)
hjr3 May 29, 2025
a4888ee
build(deps-dev): bump eslint-plugin-promise from 6.2.0 to 7.2.1 (#3479)
dependabot[bot] Jun 5, 2025
03642ab
build(deps-dev): bump semver from 4.3.6 to 7.7.2 (#3477)
dependabot[bot] Jun 5, 2025
0ada72e
docs: add `maxLifetimeSeconds` to Pool docs (#3484)
birjj Jun 12, 2025
6b016b3
fix(pg-cloudflare): use conditional export to support bundlers that d…
CHC383 Jun 12, 2025
7ab5923
Redact input URL string to prevent console printing (#3486)
brianc Jun 14, 2025
114a03e
Add package.json in exports (#3488)
remorses Jun 14, 2025
8608fb8
fix: do not concatenate an array if passed to escapeLiteral. (#3489)
brianc Jun 14, 2025
14dc8dd
Use performance.now() instead of Date.now()... (#3483)
bitifet Jun 14, 2025
607efc1
Bump engines since we do not test lower than 16 anymore (#3490)
brianc Jun 17, 2025
cd877a5
Publish
brianc Jun 18, 2025
e00aac1
Fixes for binary protocol array handling (#3494)
hjr3 Jun 19, 2025
1a25d12
Publish
brianc Jun 19, 2025
54964ec
Replace `cloudflare` export condition in `pg-cloudflare` with `worker…
jamesopstad Jun 26, 2025
0ad6c9b
fix: typos (#3499)
nigrosimone Jun 26, 2025
f0d1c48
Update package exports to support more formats (#3500)
brianc Jun 27, 2025
8f8e731
Publish
brianc Jun 27, 2025
235d7ad
build(deps-dev): bump node-gyp from 10.2.0 to 11.2.0 (#3501)
dependabot[bot] Jul 2, 2025
54e0424
build(deps-dev): bump eslint-plugin-prettier from 5.2.6 to 5.5.1 (#3502)
dependabot[bot] Jul 2, 2025
c8fb1e9
feat(pg-connection-string): warn if non-standard ssl options are used…
hjr3 Jul 7, 2025
fab87b2
Add package.json export to `pg-cloudflare` (#3506)
remorses Jul 8, 2025
43b8692
Add tests for export (#3507)
brianc Jul 9, 2025
01fadd9
fix #3508 - recheck min client count during idle callback (#3509)
barryhagan Jul 10, 2025
27a2754
Deprecations (#3510)
brianc Jul 17, 2025
1b2bedc
feat(pg-connection-string): throw correct error when URL parsing fails
mathiasbockwoldt Jul 28, 2025
a6c1084
Update bugs and homepage links for `pg-pool` (#3528)
jamesbvaughan Aug 5, 2025
65bc3d4
build(deps-dev): bump node-gyp from 11.2.0 to 11.3.0 (#3526)
dependabot[bot] Aug 8, 2025
f5c90a5
docs: fix typo in pool docs (#3530)
prasadawhale Aug 20, 2025
9174783
test: Replace dead row length check with similar shape check (#3532)
charmander Aug 22, 2025
8d493f3
feat: add Node.js version 25 to CI workflow (#3556)
nigrosimone Oct 22, 2025
ecff60d
fix: Avoid retaining buffer for latest parse in reader (#3533)
charmander Dec 11, 2025
8750cad
Update changelog
brianc Jan 14, 2026
d10e09c
Publish
brianc Jan 14, 2026
6bf475c
Improve Deno compatibility: config-first and safe env access (#3547)
Jobians Jan 14, 2026
5a581bb
Update Medplum logo source in index.mdx (#3567)
The-Alchemist Jan 14, 2026
b94c8e1
Don't use prefix import as it breaks in old nodes. (#3578)
brianc Jan 15, 2026
4eb7529
Publish
brianc Jan 15, 2026
a3a4567
remove unused variable (#3562)
lorenzofox3 Jan 19, 2026
ea06db5
Remove node: prefix from imports (#3584)
brianc Jan 20, 2026
5b68a11
Publish
brianc Jan 20, 2026
57e93b5
Return the client instance in the `connect()` method (#3564)
franciscop Jan 27, 2026
a158f03
docs: code style consistency
charmander Jan 28, 2026
d24ca25
pg-connection-string: Support environments where node:process isn’t a…
charmander Jan 30, 2026
0d1541d
Always check if activeQuery is null before using it (#3586)
rhodey Jan 30, 2026
7b7230c
Update changelog
brianc Jan 30, 2026
fc4de3c
Publish
brianc Jan 30, 2026
3c1c4c9
perf: cache parsers per column (#3568)
nigrosimone Feb 2, 2026
7b917a8
build(deps-dev): bump vite from 6.3.5 to 7.1.7 (#3552)
dependabot[bot] Feb 2, 2026
2d08681
docs(pg-native): installation (#3542)
nigrosimone Feb 2, 2026
7472fbd
docs(pg-native): installation (#3541)
nigrosimone Feb 2, 2026
46cdf9e
[fix] fix unhandled callback error for submittables (#3589)
Feb 3, 2026
b2e9cb1
Remove testAsync - its redundant (#3588)
brianc Feb 3, 2026
f332f28
fix: Connection timeout handling for native clients in connected stat…
maxbronnikov10 Feb 3, 2026
3ea6537
chore: upgrade devcontainer at node 22 and add python3 for pg-native …
nigrosimone Feb 10, 2026
d8c5bf6
Update readme. Remove reference to node-pool as it is no longer used …
brianc Feb 10, 2026
0b64e4d
docs: Remove `rejectUnauthorized: false` when specifying a CA
charmander Feb 12, 2026
a3eeecb
docs: Remove redundant Buffer → string conversions in TLS configuration
charmander Feb 12, 2026
d80d883
test: Fix TLS connection test ending too early
charmander Feb 12, 2026
e6e3692
Pass connection parameters to password callback (#3602)
brianc Feb 12, 2026
01e0556
fix(pg-query-stream): invoke `this.callback` on cursor end/error (#2810)
aleclarson Feb 13, 2026
a215bfb
Typo fix in PgPass deprecation (funciton) (#3605)
bigpresh Feb 23, 2026
5a4bafc
Deprecate Client's internal query queue (#3603)
brianc Feb 24, 2026
ebc14ca
Update changelog
brianc Feb 25, 2026
f2d7d11
Publish
brianc Feb 25, 2026
ec90a3c
docs: `keepAlive` and `keepAliveInitialDelayMillis` (#3609)
charmander Feb 25, 2026
d90db86
Fix mocha in node 25 (#3610)
brianc Feb 25, 2026
f0f01ec
docs: upgrade to nextra v3 (#3549)
McAllaster Feb 25, 2026
9e8274f
Add explicit dependency to typescript for docs (#3611)
brianc Feb 25, 2026
cb2fce5
build(deps-dev): bump semver from 7.7.2 to 7.7.4 (#3614)
dependabot[bot] Mar 2, 2026
ad36e3c
fix: typo in deprecation notice for `client.query()` (#3618)
BobbieGoede Mar 2, 2026
0c7040e
Add `onConnect` callback which allows "setup" of a pooled client (#3620)
brianc Mar 4, 2026
1c8c710
Update changelog
brianc Mar 4, 2026
c9070cc
Publish
brianc Mar 4, 2026
becad88
chore: rebrand packages to @supabase scope
avallete May 11, 2026
0fa3906
ci: replace upstream test workflow with @supabase publish workflows
avallete May 11, 2026
9b170b4
feat: add maxResultSize limit
avallete May 11, 2026
057e8cc
fix(pg-protocol): bubble up parser error avoid uncatchable exception
avallete May 11, 2026
eac72c7
chore: incorporate prior fork history (ours)
avallete May 11, 2026
796a957
chore: restore fork-specific repo URLs and packageManager pin
avallete May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM node:20
FROM node:22

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -35,7 +35,7 @@ RUN apt-get update \
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get -y install --no-install-recommends yarn tmux locales postgresql \
&& apt-get install libpq-dev g++ make \
&& apt-get install libpq-dev python3 g++ make \
#
# Install eslint globally
&& npm install -g eslint \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
- db:db

db:
image: postgres:14-alpine
image: postgres:14
restart: unless-stopped
ports:
- 5432:5432
Expand Down
22 changes: 18 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": ["@typescript-eslint", "prettier"],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:prettier/recommended", "prettier"],
"extends": ["eslint:recommended", "plugin:prettier/recommended", "prettier"],
"ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*", "packages/pg-query-stream/dist/**/*"],
"parserOptions": {
"ecmaVersion": 2017,
Expand All @@ -14,8 +14,22 @@
},
"rules": {
"@typescript-eslint/no-unused-vars": ["error", {
"args": "none"
"args": "none",
"varsIgnorePattern": "^_$"
}],
"no-unused-vars": "off"
}
"no-unused-vars": ["error", {
"args": "none",
"varsIgnorePattern": "^_$"
}],
"no-var": "error",
"prefer-const": "error"
},
"overrides": [
{
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
"rules": {
"no-undef": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pg-protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '18'
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '18'
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dist
.DS_Store
/.eslintcache
.vscode/
manually-test-on-heroku.js
manually-test-on-heroku.js
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ For richer information consult the commit log on github with referenced pull req

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

## pg@8.20.0

- Add [onConnect](https://github.com/brianc/node-postgres/pull/3620) callback to pg.Pool constructor options allowing for async initialization of newly created & connected pooled clients.

## pg@8.19.0

- [Deprecate interal query queue](https://github.com/brianc/node-postgres/pull/3603).
- Pass connection parameters [to password callback](https://github.com/brianc/node-postgres/pull/3602).

## pg@8.18.0

- [Return the client instance](https://github.com/brianc/node-postgres/pull/3564) as the result of calling `connect` (previously it was `void`).

## pg@8.17.0

- Throw correct error if database URL parsing [fails](https://github.com/brianc/node-postgres/issues/3513).

## pg@8.16.0

- Add support for [min connection pool size](https://github.com/brianc/node-postgres/pull/3438).

## pg@8.15.0

- Add support for [esm](https://github.com/brianc/node-postgres/pull/3423) importing. CommonJS importing is still also supported.

## pg@8.14.0

- Add support from SCRAM-SAH-256-PLUS i.e. [channel binding](https://github.com/brianc/node-postgres/pull/3356).
Expand Down
20 changes: 20 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# node-postgres docs website

This is the documentation for node-postgres which is currently hosted at [https://node-postgres.com](https://node-postgres.com).

## Development

To run the documentation locally, you need to have [Node.js](https://nodejs.org) installed. Then, you can clone the repository and install the dependencies:

```bash
cd docs
yarn
```

Once you've installed the deps, you can run the development server:

```bash
yarn dev
```

This will start a local server at [http://localhost:3000](http://localhost:3000) where you can view the documentation and see your changes.
3 changes: 1 addition & 2 deletions docs/components/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import { Callout } from 'nextra-theme-docs'
import { Callout } from 'nextra/components'

export const Alert = ({ children }) => {
return (
Expand Down
3 changes: 1 addition & 2 deletions docs/components/info.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react'
import { Callout } from 'nextra-theme-docs'
import { Callout } from 'nextra/components'

export const Info = ({ children }) => {
return <Callout emoji="ℹ️">{children}</Callout>
Expand Down
9 changes: 9 additions & 0 deletions docs/components/logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type Props = {
src: string
alt?: string
}

export function Logo(props: Props) {
const alt = props.alt || 'Logo'
return <img src={props.src} alt={alt} width={100} height={100} style={{ width: 400, height: 'auto' }} />
}
11 changes: 7 additions & 4 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// next.config.js
const withNextra = require('nextra')({
import nextra from 'nextra'

const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.js',
// optional: add `unstable_staticImage: true` to enable Nextra's auto image import
})

module.exports = withNextra()
export default withNextra({
output: 'export',
images: { unoptimized: true },
})
16 changes: 9 additions & 7 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
"version": "1.0.0",
"description": "",
"main": "next.config.js",
"type": "module",
"scripts": {
"start": "next dev",
"build": "next build && next export"
"dev": "next dev",
"build": "next build"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"next": "^15.5.10",
"nextra": "2.0.0-beta.29",
"nextra-theme-docs": "2.0.0-beta.29",
"react": "^17.0.1",
"react-dom": "^17.0.1"
"next": "^13.5.11",
"nextra": "^3.3.1",
"nextra-theme-docs": "^3.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.0.2"
}
}
6 changes: 1 addition & 5 deletions docs/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'nextra-theme-docs/style.css'

export default function Nextra({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
</>
)
return <Component {...pageProps} />
}
5 changes: 5 additions & 0 deletions docs/pages/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
index: 'Welcome',
announcements: 'Announcements',
apis: 'API',
}
5 changes: 0 additions & 5 deletions docs/pages/_meta.json

This file was deleted.

8 changes: 8 additions & 0 deletions docs/pages/apis/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
client: 'pg.Client',
pool: 'pg.Pool',
result: 'pg.Result',
types: 'pg.Types',
cursor: 'Cursor',
utilities: 'Utilities',
}
8 changes: 0 additions & 8 deletions docs/pages/apis/_meta.json

This file was deleted.

23 changes: 12 additions & 11 deletions docs/pages/apis/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ type Config = {
lock_timeout?: number, // number of milliseconds a query is allowed to be en lock state before it's cancelled due to lock timeout
application_name?: string, // The name of the application that created this Client instance
connectionTimeoutMillis?: number, // number of milliseconds to wait for connection, default is no timeout
idle_in_transaction_session_timeout?: number // number of milliseconds before terminating any session with an open idle transaction, default is no timeout
keepAlive?: boolean, // if true, enable keepalive on the `net.Socket`
keepAliveInitialDelayMillis?: number, // number of milliseconds between last data packet received and first keepalive probe, default is 0 (keep existing value);
// no effect unless `keepAlive` is true
idle_in_transaction_session_timeout?: number, // number of milliseconds before terminating any session with an open idle transaction, default is no timeout
client_encoding?: string, // specifies the character set encoding that the database uses for sending data to the client
fallback_application_name?: string, // provide an application name to use if application_name is not set
options?: string // command-line options to be sent to the server
}
```

example to create a client with specific connection information:

```js
import pg from 'pg'
const { Client } = pg
import { Client } from 'pg'

const client = new Client({
user: 'database-user',
Expand All @@ -45,8 +50,7 @@ const client = new Client({
## client.connect

```js
import pg from 'pg'
const { Client } = pg
import { Client } from 'pg'
const client = new Client()

await client.connect()
Expand Down Expand Up @@ -88,8 +92,7 @@ client.query(text: string, values?: any[]) => Promise<Result>
**Plain text query**

```js
import pg from 'pg'
const { Client } = pg
import { Client } from 'pg'
const client = new Client()

await client.connect()
Expand All @@ -103,8 +106,7 @@ await client.end()
**Parameterized query**

```js
import pg from 'pg'
const { Client } = pg
import { Client } from 'pg'
const client = new Client()

await client.connect()
Expand Down Expand Up @@ -142,8 +144,7 @@ await client.end()
If you pass an object to `client.query` and the object has a `.submit` function on it, the client will pass it's PostgreSQL server connection to the object and delegate query dispatching to the supplied object. This is an advanced feature mostly intended for library authors. It is incidentally also currently how the callback and promise based queries above are handled internally, but this is subject to change. It is also how [pg-cursor](https://github.com/brianc/node-pg-cursor) and [pg-query-stream](https://github.com/brianc/node-pg-query-stream) work.

```js
import pg from 'pg'
const { Query } = pg
import { Query } from 'pg'
const query = new Query('select $1::text as name', ['brianc'])

const result = client.query(query)
Expand Down
14 changes: 5 additions & 9 deletions docs/pages/apis/cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ $ npm install pg pg-cursor
Instantiates a new Cursor. A cursor is an instance of `Submittable` and should be passed directly to the `client.query` method.

```js
import pg from 'pg'
const { Pool } = pg
import { Pool } from 'pg'
import Cursor from 'pg-cursor'

const pool = new Pool()
Expand All @@ -29,11 +28,9 @@ const values = [10]

const cursor = client.query(new Cursor(text, values))

cursor.read(100, (err, rows) => {
cursor.close(() => {
client.release()
})
})
const { rows } = await cursor.read(100)
console.log(rows.length) // 100 (unless the table has fewer than 100 rows)
client.release()
```

```ts
Expand All @@ -58,8 +55,7 @@ If the cursor has read to the end of the result sets all subsequent calls to cur
Here is an example of reading to the end of a cursor:

```js
import pg from 'pg'
const { Pool } = pg
import { Pool } from 'pg'
import Cursor from 'pg-cursor'

const pool = new Pool()
Expand Down
Loading