Skip to content

chore(deps): upgrade postgres.js from 3 to 4 - #27

Merged
mattdecrevel merged 3 commits into
mainfrom
chore/postgres-4
Nov 22, 2026
Merged

mattdecrevel merged 3 commits into
mainfrom
chore/postgres-4

Conversation

@mattdecrevel

@mattdecrevel mattdecrevel commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Replaces Dependabot #24. Includes #26's zod fix (merged in) so this builds on its own; merge #26 first and that commit drops out of this diff.

Why it is safe

postgres.js 4 keeps v3's API. Its upgrade notes list these changes:

  • Parameter types are decided by the server. This only changes behaviour for timestamp / date / time columns outside UTC; every timestamp in lib/db/schema.ts is timestamptz.
  • sql.array() removed. Not used.
  • Stricter transactions. drizzle uses sql.begin / savepoint, which stay supported.
  • ESM only. loop is already "type": "module".

drizzle-orm 0.45 declares postgres >=3, and still hooks options.parsers / options.serializers, which v4 keeps.

Verified

I ran a smoke script against a real Postgres 16 whose session time zone is America/Chicago, on v3 and then on v4. It covered:

  • migrations
  • inserts with jsonb, enums and booleans
  • onConflictDoNothing
  • an inArray update
  • lte against both now() and a Date parameter
  • the reminders page's case ordering
  • nested transactions (savepoint) and rollback
  • db.execute

The JSON output is identical between v3 and v4. Also:

After merging, the first production deploy runs scripts/migrate.ts against Neon on v4. Watch that deploy log.


Generated by Claude Code

Zod 4 dropped the single-argument z.record(value). The npm-security bump
(#20) moved loop to zod 4, and every production build since has failed at
next build's type check. The parse result is unchanged: the old call
already accepted string keys at runtime.

CI now runs tsc, because CI only ran tests and Vercel skips Dependabot
branches, so nothing checked types before merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uau5YjL2L7Vm7xh3B7jzUX
The API is unchanged for what loop uses. v4's main behaviour change is
that the server now types Date and boolean parameters; every timestamp
column here is timestamptz, so no stored value is read differently.

Verified against a real Postgres 16 in a non-UTC time zone: migrations,
inserts with jsonb, enums and booleans, onConflictDoNothing,
inArray updates, Date parameters, nested transactions and rollback all
return output identical to v3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uau5YjL2L7Vm7xh3B7jzUX
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loop Ready Ready Preview Nov 22, 2026 5:19pm UTC

Request Review

Copy link
Copy Markdown
Owner Author

The Vercel build fails at lib/events/schemas.ts(51,55): Expected 2-3 arguments, but got 1. That's the zod 4 z.record call already broken on main (every production deploy since #20), not this PR's change. #26 fixes it; once #26 merges, this branch's build goes green.


Generated by Claude Code

@mattdecrevel
mattdecrevel marked this pull request as ready for review November 22, 2026 17:17
@mattdecrevel
mattdecrevel merged commit 37d9849 into main Nov 22, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — c6cebb0a Deployed Nov 22, 2026 by vercel[bot]
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