Uh oh!
There was an error while loading. Please reload this page.
[feat] @workflow/world-postgres: migrate from postgres.js to pg - #1484
Conversation
🦋 Changeset detectedLatest commit: 30c38c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@jlalmes is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
--- DCO Remediation Commit for James Berry <jb@jamesbe.com> I, James Berry <jb@jamesbe.com>, hereby add my Signed-off-by to this commit: 600d39b Signed-off-by: James Berry <jb@jamesbe.com>
VaguelySerious
left a comment
There was a problem hiding this comment.
LGTM! Could you merge main + fix the doc typecheck on the PR?
jlalmes
commented
Mar 23, 2026
@VaguelySerious, just merged main. Can't see any doc typecheck failures though.. Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
…naygp-db9e68c1 * 'main' of https://github.com/vercel/workflow: (32 commits) chore: bump @nestjs/* to ^11.1.17 (#1497) chore: bump hono to ^4.12.8 (#1495) Revert "Inline class serialization registration to fix 3rd-party package supp…" (#1493) [world] Add stream pagination and metadata endpoints (#1470) [cli] [world-local] Ensure update checks don't suggest upgrading from stable release to pre-releases (#1490) Remove NestJS Vercel integration while in experimental phase (#1485) feat: export semantic error types and add API reference docs (#1447) feat: enforce max queue deliveries in handlers with graceful failure (#1344) [world-postgres] Migrate client from `postgres.js` to `pg` (#1484) Inline class serialization registration to fix 3rd-party package support (#1480) [ai] Add experimental_context to DurableAgentOptions (#1489) [ai] Expose configured tools on DurableAgent instances (#1488) fix(builders): catch node builtin usage when entry fields diverge (#1455) [web-shared] Fix timeline duration format and precision (#1482) [cli] Add bulk cancel, --status filter, fix step JSON hydration (#1467) [utils] Re-export parseName utilities and add workflow/observability module (#1453) [o11y] Polish display when run data has expired (#1438) Add CommonJS `require()` support for class serialization detection in SWC plugin (#1144) fix(next): stabilize deferred canary e2e in nextjs workbenches (#1468) [web] Support legacy newline-delimited stream format in `useStreamReader` (#1473) ...
…naygp-6fadd605 * 'main' of https://github.com/vercel/workflow: (73 commits) chore: bump next to 16.2.1 and fix deferred build (#1496) chore: bump nitropack to ^2.13.1 (#1501) chore: bump nuxt ecosystem dependencies (#1500) chore: bump sveltekit ecosystem (#1498) chore: bump express and fastify in workbenches (#1499) chore: bump @nestjs/* to ^11.1.17 (#1497) chore: bump hono to ^4.12.8 (#1495) Revert "Inline class serialization registration to fix 3rd-party package supp…" (#1493) [world] Add stream pagination and metadata endpoints (#1470) [cli] [world-local] Ensure update checks don't suggest upgrading from stable release to pre-releases (#1490) Remove NestJS Vercel integration while in experimental phase (#1485) feat: export semantic error types and add API reference docs (#1447) feat: enforce max queue deliveries in handlers with graceful failure (#1344) [world-postgres] Migrate client from `postgres.js` to `pg` (#1484) Inline class serialization registration to fix 3rd-party package support (#1480) [ai] Add experimental_context to DurableAgentOptions (#1489) [ai] Expose configured tools on DurableAgent instances (#1488) fix(builders): catch node builtin usage when entry fields diverge (#1455) [web-shared] Fix timeline duration format and precision (#1482) [cli] Add bulk cancel, --status filter, fix step JSON hydration (#1467) ... # Conflicts: # packages/core/src/runtime/start.ts
Summary
Migrates
@workflow/world-postgresfrom postgres.js to node-postgres (pg) and Drizzle’sdrizzle-orm/node-postgresdriver. Graphile Worker now uses the samepg.PoolviapgPool. Streaming LISTEN/NOTIFY uses a dedicatedpg.Clientbuilt fromnew Client(pool.options)so the long-lived listener does not hold a connection checked out from the shared pool.createWorldaccepts an optionalpool. When the world creates its own pool fromconnectionString,world.close()ends that pool; whenpoolis passed in,world.close()does not end it (caller owns lifecycle).Motivation
pg.Poolso workflow storage and userland code can share connection configuration and pooling behavior.LISTEN(dedicated client for notifications).Breaking changes
postgres(postgres.js) dependency; consumers that depended on postgres.js-specific behavior or types must switch topg.Implementation notes
drizzle-orm/postgres-js→drizzle-orm/node-postgres;createClient(pool)wraps the shared pool.makeWorkerUtils/runusepgPool: pool; PgBoss migration SQL usespool.queryandresult.rows.pg_notifyvia the pool;listenChannelinlisten-channel.tsuses a dedicated client frompool.options.drizzle-orm/node-postgres/migratorand a smallPoolfor setup.PostgresWorldConfigis a discriminated union: eitherconnectionStringorpool, plus existing job options.Docs
pg, optionalpool, and dedicated LISTEN client.Changelog
@workflow/world-postgres(patch; breaking called out in body per repo convention).