Use pg in Hyperdrive Postgres examples - #28119
Merged
Merged
Conversation
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
ask-bonk
Bot
requested review from
Oxyjun,
elithrar,
sejoker and
thomasgauvin
as code owners
February 5, 2026 21:38
Contributor
|
This PR requires additional review attention because it affects the following areas: PartialsThis PR updates partial files, which are pieces of content used across multiple files in our Render component.
|
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
elithrar
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All changes are complete. Here's a summary of what was changed across 5 files:
Changes Made
1.
src/content/docs/hyperdrive/index.mdx— Replaced the PostgreSQL tab's overview code snippet frompostgres(Postgres.js) topg(node-postgres). Usesimport { Client } from "pg",new Client(...),await client.connect(), andawait client.query(...).2.
src/content/docs/hyperdrive/configuration/connect-to-private-database.mdx— Changed the "Query your database" section (step 3.2) from rendering theuse-postgres-js-to-make-querypartial touse-node-postgres-to-make-query. Updated the surrounding text to reference node-postgres instead of Postgres.js.3.
src/content/docs/hyperdrive/examples/connect-to-postgres/index.mdx— Removed the extra prose line "The following Workers code shows you how to use Postgres.js with Hyperdrive" before the Postgres.js partial render (the partial already has its own context). The node-postgres section remains the primary example listed first.4.
src/content/docs/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/drizzle-orm.mdx— Updated the Drizzle ORM example from usingpostgres(Postgres.js) as the underlying driver topg(node-postgres):npm i drizzle-orm pg dotenv+@types/pgas dev depimport { Client } from "pg"andimport { drizzle } from "drizzle-orm/node-postgres"new Client(...),await client.connect(), thendrizzle(client)5.
src/content/partials/hyperdrive/use-node-postgres-to-make-query.mdx— Fixed a bug where the error handler was missingreturnbeforenew Response(...), which would cause the function to returnundefinedinstead of a 500 response.What was NOT changed (intentionally)
postgres-drivers-and-libraries/postgres-js.mdx) and its partial (use-postgres-js-to-make-query.mdx) remain as-is — Postgres.js is still a supported driver and should keep its own documentation page.connect-to-postgres/index.mdxstill renders the Postgres.js partial as an alternative example.Closes #26509
github run