Skip to content

Add noPreparedStatements option for connection pools#1880

Open
Pom4H wants to merge 1 commit intovercel:mainfrom
Pom4H:claude/add-pglite-support-0hum0
Open

Add noPreparedStatements option for connection pools#1880
Pom4H wants to merge 1 commit intovercel:mainfrom
Pom4H:claude/add-pglite-support-0hum0

Conversation

@Pom4H
Copy link
Copy Markdown
Contributor

@Pom4H Pom4H commented Apr 30, 2026

Summary

Add noPreparedStatements support to @workflow/world-postgres and forward it to the embedded graphile-worker queue.

This is needed when the PostgreSQL connection goes through a pool/proxy/adapter that cannot safely preserve per-session prepared statements, such as PgBouncer in transaction pooling mode. It is also useful for PGlite-socket-like adapters where session semantics may differ from a normal dedicated PostgreSQL backend connection.

Changes

  • Add noPreparedStatements?: boolean to PostgresWorldConfig
  • Add WORKFLOW_POSTGRES_NO_PREPARED_STATEMENTS=1|true env support
  • Forward noPreparedStatements: true to graphile-worker makeWorkerUtils()
  • Forward noPreparedStatements: true to graphile-worker run()
  • Keep the default behavior unchanged by omitting the option unless explicitly enabled
  • Add unit coverage for enabled and default scenarios
  • Document the option in packages/world-postgres/README.md
  • Add changeset for @workflow/world-postgres

Notes

This option only affects the embedded graphile-worker queue. It does not change how the shared pg.Pool, Drizzle client, or stream storage issue queries.

…Glite

Forwards graphile-worker's noPreparedStatements flag through createWorld()
config and a WORKFLOW_POSTGRES_NO_PREPARED_STATEMENTS env var. Required when
the pool routes traffic through a layer that cannot honour per-session
prepared statements (PgBouncer txn mode, PGlite-socket).
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 30, 2026

🦋 Changeset detected

Latest commit: f1dd636

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@workflow/world-postgres Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 30, 2026

@claude is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants