GeezerVison is showing github.com — chore: sync upstream/master + bump @supabase/pg to 8.21.0, pg-protocol to 1.13.1 by avallete · Pull Request #31 · supabase/node-postgres
Conversation
What
Pulls in 16 upstream commits accumulated since the [email protected] tag we synced to in #29. Bumps:
@supabase/pg-protocol → 1.13.1 (patch — only buffer-reader.ts saw a one-line change plus tsconfig + eslint config tweaks; no API change)
@supabase/pg → 8.21.0 (minor — adds public client.getTransactionStatus() method, per semver)
Why
Upstream has not published a new tag since [email protected], so this picks up unreleased upstream master rather than aligning with a published tag like #29 did. Worth shipping anyway because of:
How (merge mechanics)
A plain git merge upstream/master resolved cleanly with one trivial conflict: upstream modified the .github/workflows/ci.yml file we previously deleted. Kept it deleted (the deploy-pg.yml + deploy-pg-protocol.yml workflows on master remain the publish path; we don't run upstream's test matrix).
All five fork patches auto-merged with no conflict because upstream's edits were in different files or different hunks:
| Fork patch |
Upstream changed same file? |
Outcome |
@supabase/* rebrand (root + pg + pg-protocol package.json) |
Yes (no version bump) |
Auto-merged |
| Sub-package URL restorations (cloudflare, connection-string, cursor, native, pool, query-stream) |
Yes (no URL change) |
Auto-merged |
maxResultSize in pg/lib/connection.js |
No |
Untouched |
maxResultSize in pg/lib/client.js |
Yes (added getTransactionStatus in different hunk) |
Auto-merged |
maxResultSize + connection back-ref in pg/lib/native/client.js |
Yes (added native getTransactionStatus in different hunk) |
Auto-merged |
maxResultSize in pg/lib/native/query.js |
No |
Untouched |
maxResultSize in pg/lib/defaults.js |
No |
Untouched |
maxResultSize-tests.js |
No |
Untouched |
Parser try/catch in pg-protocol/src/parser.ts |
No (upstream only changed buffer-reader.ts) |
Untouched |
pg/README.md npm install @supabase/pg |
Yes (different line) |
Auto-merged |
Root package.json packageManager field |
Yes (eslint devDeps section) |
Auto-merged |
Validation
packages/pg-protocol: npm install --workspaces=false --prefix . + npm run build succeeds → 74 unit tests pass.
packages/pg: node --check passes on every modified lib/*.js, lib/native/*.js, lib/crypto/sasl.js (the upstream-changed file).
npm publish --dry-run succeeds for both packages, producing the expected supabase-pg-protocol-1.13.1.tgz and supabase-pg-8.21.0.tgz.
- Full
pg integration tests will run post-publish via postgres-meta CI, same pattern as chore: upgrade fork to upstream [email protected] #29.
⚠️ Merge order
This PR must merge AFTER #30 (fix(ci): make deploy workflows self-bootstrapping).
If merged first, the deploy workflows on the merge commit will hit the same Couldn't find any versions for "@supabase/pg-protocol" that matches "^1.13.1" install failure that broke the post-#29 publishes (the chicken-and-egg fixed by #30).
After #30 lands and this PR merges, both deploy-pg.yml and deploy-pg-protocol.yml will trigger automatically (both packages/pg/** and packages/pg-protocol/** paths changed) and successfully publish @supabase/[email protected] and @supabase/[email protected] to npm.
Test plan
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* Add docs for
* Add docs for max uses
* Clean up casing and grammar in comments
* Add more docs on pool sizing
* Grammar
* Add better footer
* Final updates
* Update readme text slightly
* Better words
* Upgrade eslint and typescript
* eslint: Port config to new flat config format
* Fix preserve-caught-error eslint warning
* Drop unused eslint-disable-line
* pg-cloudflare: Fix typescript errors
- rootDir defaults have changed, so we need to specify it manually now
- baseUrl is no longer supported
- types no longer loads everything in @types by default, so we have to specify
that we want node types
- Pin @types/node to 16.* because we support node16 and above
* pg-cloudflare: Workaround typescript bug regarding Buffer.from
Fixes the following error:
% yarn build
yarn run v1.22.19
$ tsc --build
packages/pg-cloudflare/src/index.ts:156:29 - error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'ArrayBuffer | Uint8Array<ArrayBufferLike>' is not assignable to parameter of type 'WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: "string"): string; }'.
Type 'ArrayBuffer' is not assignable to type 'WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: "string"): string; }'.
156 const hex = Buffer.from(data).toString('hex')
~~~~
node_modules/@types/node/buffer.buffer.d.ts:83:13
83 from(
~~~~~
84 str:
~~~~~~~~~~~~~~~~~~~~
...
89 encoding?: BufferEncoding,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90 ): Buffer<ArrayBuffer>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The last overload is declared here.
Found 1 error.
See microsoft/TypeScript#63447 for more info
* Fix tsconfig for pg-protocol and pg-query-stream
* Standardize @types/node on ^16
Fixes the following typescript error:
node_modules/typescript/lib/lib.esnext.intl.d.ts:26:135 - error TS2552: Cannot find name 'DateTimeRangeFormatPart'. Did you mean 'DateTimeFormatPart'?
26 formatRangeToParts(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): DateTimeRangeFormatPart[];
* pg-protocol: Narrow type of BufferReader.encoding
`BufferReader.encoding` to `BufferEncoding` from `string` to match the new
signature of `Buffer.toString`.
* pg-query-stream: Bump eslint-plugin-promise to fix unmet peer dependency
* Run eslint on its own config
* chore: update libpq to 1.11.0
* chore: add node 26
)
* fix(pg-connection-string): prototype pollution via query strings
* fix(pg): prototype pollution via server-supplied column names
Fixes brianc#3654
* feat: add new client.getTransactionStatus() method
Adds a new public method to retrieve the current transaction status
of the client connection. Returns 'I' (idle), 'T' (in transaction),
'E' (error/aborted), or null (initial state/native client).
The transaction status is tracked from PostgreSQL's ReadyForQuery
message after each query completes.
Native client returns null as it does not support this feature yet.
* feat: add native client support for getTransactionStatus()
- Add getTransactionStatus() to pg-native using libpq's
PQtransactionStatus() with status mapping (0->I, 2->T, 3->E)
- Update pg native client wrapper to delegate to pg-native
- Remove native guard from txstatus tests (now runs in both modes)
- Bump libpq to ^1.10.0 for transactionStatus() binding support
* docs
* Tests
* fix: docs
* clear docs
---------
Co-authored-by: Brian C <[email protected]>
* Add error handling for non-function callback
catch callback not a function earlier to get a proper callstack. later when executing the callback the stack may be wrong/insufficient.
* fix: lint
* fix: lint
* fix: test
* feat: add test for new error
…l to 1.13.1
Pulls in 16 upstream commits since the [email protected] tag we synced to in #29.
Most notable:
- 7674d8c Fix pg prototype pollution via server supplied column names
(brianc#3656) — security fix, primary motivation for this sync.
- 939725e feat: add new client.getTransactionStatus() method (brianc#3645)
- 7ba4efe Handle SASL SCRAM server error responses (brianc#3521)
- 3bb9fba Add error handling for non-function callback (brianc#3561)
- 0f56b76 Throw TypeError instead of base Error when query callback is
not a function
- 1025d12 Node JS 26 (brianc#3667)
- 02367b8 Upgrade eslint and typescript (brianc#3662) — replaces .eslintrc
with eslint.config.mjs, bumps @typescript-eslint/* to ^8, eslint to
^10, typescript to ^6 in root devDependencies.
- Various docs / tests / dependabot bumps.
Merge mechanics: a plain `git merge upstream/master` resolved cleanly
with one trivial conflict — upstream modified the .github/workflows/
ci.yml file we previously deleted. We kept it deleted (the
deploy-pg.yml + deploy-pg-protocol.yml workflows on master remain the
publish path; we don't run upstream's test matrix). All five fork
patches (rebrand + CI workflows + maxResultSize + parser try/catch +
URL/README/packageManager restorations) auto-merged without conflict
because upstream's edits were in different files or different hunks.
Versioning: upstream has not published a new tag since [email protected], so
this is a pick-up of unreleased upstream master rather than an
align-with-upstream-tag bump like #29 was. Chose:
- @supabase/[email protected] (patch — only buffer-reader.ts saw a
one-line change plus tsconfig + eslint config tweaks; no API change)
- @supabase/[email protected] (minor — adds public client.getTransactionStatus
method per semver)
Reviewers
soedirgo
soedirgo approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|