Skip to content

Use pg in Hyperdrive Postgres examples - #28119

Merged
elithrar merged 1 commit into
productionfrom
opencode/issue26509-20260205213301
Feb 6, 2026
Merged

Use pg in Hyperdrive Postgres examples#28119
elithrar merged 1 commit into
productionfrom
opencode/issue26509-20260205213301

Conversation

@ask-bonk

@ask-bonk ask-bonk Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

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 from postgres (Postgres.js) to pg (node-postgres). Uses import { Client } from "pg", new Client(...), await client.connect(), and await client.query(...).

2. src/content/docs/hyperdrive/configuration/connect-to-private-database.mdx — Changed the "Query your database" section (step 3.2) from rendering the use-postgres-js-to-make-query partial to use-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 using postgres (Postgres.js) as the underlying driver to pg (node-postgres):

  • Install command: npm i drizzle-orm pg dotenv + @types/pg as dev dep
  • Import: import { Client } from "pg" and import { drizzle } from "drizzle-orm/node-postgres"
  • Code: uses new Client(...), await client.connect(), then drizzle(client)

5. src/content/partials/hyperdrive/use-node-postgres-to-make-query.mdx — Fixed a bug where the error handler was missing return before new Response(...), which would cause the function to return undefined instead of a 500 response.

What was NOT changed (intentionally)

  • The Postgres.js dedicated example page (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.
  • The Postgres.js section under connect-to-postgres/index.mdx still renders the Postgres.js partial as an alternative example.

Closes #26509

github run

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@ask-bonk
ask-bonk Bot requested a review from a team February 5, 2026 21:38
@github-actions github-actions Bot added product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ size/s labels Feb 5, 2026
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

This PR requires additional review attention because it affects the following areas:

Partials

This PR updates partial files, which are pieces of content used across multiple files in our Render component.

@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/hyperdrive/ @elithrar, @thomasgauvin, @sejoker, @oxyjun, @cloudflare/pcx-technical-writing
/src/content/partials/hyperdrive/ @elithrar, @thomasgauvin, @sejoker, @oxyjun, @cloudflare/pcx-technical-writing

@elithrar
elithrar merged commit 1373468 into production Feb 6, 2026
12 checks passed
@elithrar
elithrar deleted the opencode/issue26509-20260205213301 branch February 6, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear what library you recommend for interfacing with postgres using hyperdrive

4 participants