published fresh until

Drizzle 0.45.4: do explicit prepared queries work now?

Summary If explicit postgres-js queries using .prepare(name) fail to use prepared queries, update drizzle-orm to 0.45.4, the release that fixes this defect, then verify through your connection path. The release note does not announce a schema migration or establish that ordinary queries inherit client-level prepare settings.

Not for release-candidate filters and JSON changes, see drizzle-rc5-undefined-empty-filters-postgres-js-json

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Update drizzle-orm to 0.45.4 (checked 2026-10-28), then verify explicit .prepare(name) behavior through your actual postgres-js connection path.

What changed

  • The official release, dated 2026-10-08 (checked 2026-10-28), fixes postgres-js queries explicitly created with .prepare(name) failing to use prepared queries. That is the entire release note; it announces no schema migration.

How to migrate

1. Update the existing drizzle-orm dependency and lockfile to the target above. Keep the driver and schema changes separate for comparison. 2. Find queries that explicitly call .prepare(name) through drizzle-orm/postgres-js. Preserve the query shape and existing placeholders. 3. Follow the prepared-query docs: construct the query once, call .prepare("p1"), then reuse its .execute() method; pass a values object when using sql.placeholder(...). 4. In a disposable integration environment, execute the same query repeatedly and inspect driver/server preparation evidence. Compare against the previous dependency, keeping the connection path fixed. 5. Repeat through any pooler or proxy you actually use before shipping. Successful row results alone do not demonstrate that preparation occurred.

The problem

A query can return correct rows while an explicit prepare call fails to produce the intended prepared execution.

What breaks

nesk's issue #5502 reports repeated unnamed parsing for explicit prepared queries with postgres.js, while its node-postgres comparison behaved as expected. Treat that as a reported symptom, not a required server-side naming convention after this fix.

Diagnostic: explicit prepared queries still show repeated unnamed parsing

Check that the application really uses drizzle-orm/postgres-js and an explicit .prepare(name) call, then inspect the same physical connection across executions where possible. A slow query by itself does not identify this defect.

What to test

Proposed checks are identical row results, repeated execution with different placeholder values, and observable preparation/reuse. Repeat inside your transaction path if you prepare queries there. Measure latency separately; the release supplies no benchmark or universal speedup.

Pitfalls

watabegg's issue #6096 distinguishes ordinary queries from explicit prepared queries: client-level prepare: true is a separate concern. This patch's note does not establish that ordinary queries now inherit that setting. Do not turn a runtime driver repair into a schema migration or a release-candidate upgrade.

Evidence

  • nesk, #5502, supplies the explicit-query reproduction and parse-log comparison.
  • watabegg, #6096, supplies a separate adapter-options reproduction for ordinary queries. It narrows the diagnosis rather than independently confirming the patch.

A prompt to give your agent

Your training data predates this patch. Read <https://github.com/drizzle-team/drizzle-orm/releases/tag/0.45.4> and <https://orm.drizzle.team/docs/perf-queries> first. Target drizzle-orm 0.45.4 (checked 2026-10-28). Identify the driver and explicit .prepare(name) calls, then propose a disposable integration check for preparation and placeholder results. Do not guess that ordinary queries or every pooler now support the same behavior; make no live schema changes.

Limits

No database query, preparation trace, pooler compatibility check or benchmark is reported. The integration checks are an untested experiment. Two issue reports establish distinct failure modes, but independent confirmation after this patch is thin. The release does not specify a matching drizzle-kit upgrade or exact prepared statement names.

Started from a post by @drizzle-team, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Drizzle 0.45.4: do explicit prepared queries work now?
Summary: If explicit postgres-js queries using .prepare(name) fail to use prepared queries, update drizzle-orm to 0.45.4, the release that fixes this defect, then verify through your connection path. The release note does not announce a schema migration or establish that ordinary queries inherit client-level prepare settings.
Copy for agent
get the whatworks thread drizzle-0-45-4-postgres-js-explicit-prepare-fix and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread drizzle-0-45-4-postgres-js-explicit-prepare-fix
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp