Skip to content

docs: the add-to-existing-project, Drizzle, SQL ORM and Prisma 7 pages drop the Temporal workarounds for inferred date columns - #8399

Closed
wmadden-electric wants to merge 1 commit into
mainfrom
claude/queequeg-48-prisma-upgrade-8343e8
Closed

wmadden-electric wants to merge 1 commit into
mainfrom
claude/queequeg-48-prisma-upgrade-8343e8

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

Draft until the Prisma ORM release that includes prisma/orm#30553 is published. That PR merged on 2026-10-05 and is not in 8.0.0-rc.14, the current latest of @prisma/orm-postgres. Merge this with the docs update for the release that carries it.

At a glance

Run prisma contract infer against a database with a timestamptz column, with the ORM packages that include prisma/orm#30553:

model User {
  createdAt TimestamptzString @default(now()) @map("created_at")
}

Before, the same command wrote createdAt Timestamptz, and on Node.js 24 the first query that read the column failed with RUNTIME.TEMPORAL_UNAVAILABLE. The guides worked around that by installing temporal-polyfill or by telling readers to retype every date field by hand. Those workarounds come out.

What this PR changes

  1. The add-to-existing-project guide shows the contract contract infer now writes, and its date section describes text values instead of a polyfill install.
  2. The Drizzle guide loses the "Use string timestamps" review step; the review has two edits instead of three.
  3. The SQL ORM guide loses the "change Timestamptz to TimestamptzString" edit, in the prose, the diff block, the gotchas and the agent prompt.
  4. The coming-from-Prisma-7 page says that a schema.prisma read through prisma7Schema(...) gives text date values that need no Temporal.

Why the workarounds existed

Prisma ORM 8 on PostgreSQL has two families of date and time types. Timestamptz, Timestamp, Date and Time read and write Temporal values, the new JavaScript date API. TimestamptzString, TimestampString, DateString and TimeString keep the same column types and hand your code the text PostgreSQL returns. Node.js 24 and older have no global Temporal, and the application runtime deliberately bundles no fallback, so a Temporal field fails on its first read there.

prisma orm init always scaffolded the text types, so new projects never hit this. The two paths that adopt an existing database did not: contract infer, which every add-to-existing-project and switch-from-another-ORM guide runs, and prisma7Schema(...), the Prisma 7 upgrade path. Both wrote the Temporal types. The guides on this site documented the failure and told readers to install temporal-polyfill or retype the fields.

What the ORM fix changed

prisma/orm#30553 makes contract infer and prisma7Schema(...) write the text types, the same ones orm init writes. An application that adopts an existing database then reads and writes its date columns with no Temporal at all. Fields a reader writes by hand as Timestamptz or DateTime still read as Temporal values, so the pages about hand-written contracts (data-modeling, psl-syntax, the client reference, the error reference) are unchanged, and the add-to-existing-project guide keeps a sentence on how to opt back into Temporal.

The inferred contract excerpts in the three guides are realigned to match what the tool prints, since the longer type name widens the type column.

Tests

  • pnpm run lint:links, pnpm run lint:spellcheck in apps/docs: pass.
  • lint:code reports only pre-existing violations; this change removes code blocks and adds none.

Alternatives considered

  • Keep a Node.js 24 warning on the infer pages. Rejected: after the ORM change the inferred contract has no Temporal field, so there is nothing to warn about on those paths. The warning stays where it still applies, on the pages about hand-written types.
  • Update the example repository for the Prisma 7 upgrade guide in the same change. Out of scope: its prisma8/contract.prisma still uses Timestamp(3), and the guide links its step-0 to step-3 tags, so changing it means re-creating the tags. Tracked as a follow-up.

Agent: arachne-39

🤖 Generated with Claude Code

…he guides drop the Temporal workarounds

prisma/orm#30553 (TML-3366) makes contract infer and prisma7Schema write
TimestamptzString, TimestampString, DateString and TimeString, the text
types orm init already scaffolds. Applications then read and write those
columns with no global Temporal, so the add-to-existing-project guide no
longer installs temporal-polyfill, and the Drizzle and SQL ORM guides no
longer ask readers to retype every Timestamptz field by hand. The
coming-from-Prisma-7 page says the same for schema.prisma read through
prisma7Schema.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
blog Ready Ready Preview Oct 7, 2026 6:36am UTC
docs Ready Ready Preview Oct 7, 2026 6:36am UTC
eclipse Ready Ready Preview Oct 7, 2026 6:36am UTC
site Ready Ready Preview Oct 7, 2026 6:36am UTC
1 Skipped Deployment
Project Deployment Actions Updated
handbook Skipped Skipped Oct 7, 2026 6:36am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – handbook October 7, 2026 06:34 Inactive
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

91 links: ✅ 2 OK | 🚫 0 errors | 🔀 2 redirects | 👻 89 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 2
🔀 Redirected 2
👻 Excluded 89
🚫 Errors 0
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@wmadden-electric

Copy link
Copy Markdown
Contributor Author

Closing in favour of #8400, the 8.0.0-rc.15 docs update, which makes the same changes to these four pages as part of the release update and is already approved.

This branch was successfully deployed

4 active and 1 inactive deployments
Preview – docs — 71275397 Deployed Oct 7, 2026 by vercel[bot]
Preview – blog — 71275397 Deployed Oct 7, 2026 by vercel[bot]
Preview – site — 71275397 Deployed Oct 7, 2026 by vercel[bot]
Preview – eclipse — 71275397 Deployed Oct 7, 2026 by vercel[bot]
Preview – handbook — 71275397 Deployed Oct 7, 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.

1 participant