published fresh until

Prisma 8 rc.19/rc.20: how do I fix defaults and JSON?

Summary As of October 2026, Prisma 8.0.0-rc.19 and 8.0.0-rc.20 (checked 2026-10-28) require explicit client generators, typed contract values and --json for JSON-consuming scripts; port the two RC hops in order and review contract rewrites before signing databases.

Not for choosing server or ORM upgrades, see postgresql-19-prisma-8-drizzle-neon-supabase-upgrade-risks

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

Move client generators to @onCreate/@onUpdate, pass a typed contract and add --json to JSON consumers; review the two upgrade hops before signing any database.

What changed

How to migrate

1. Record the installed ORM facade, toolchain and CLI separately. Follow the app upgrade links in each release in order; extension authors need the separate extension recipes. Keep copies of schema, emitted contracts and migration snapshots for diff review. 2. Replace client-generated @default(uuid()) with @onCreate(uuid()); apply the same distinction to the other generators. Keep @default(now()) and @default(autoincrement()). The generator spelling change alone needs no database migration or contract re-emission. 3. Replace postgres<Contract>({ contractJson, ... }) with a contract value. The maintainer's complete client example imports contractFromJson from @prisma/orm-postgres/static, constructs contractFromJson<Contract>(contractJson) once, and calls postgres({ contract, ... }). Update test files too. 4. For stored type aliases, review the release-linked rewrite script's changes to contracts and migration snapshots, then run prisma contract emit. The documented follow-up is prisma db sign for each affected database, including Supabase; schedule that as a reviewed operational step after checking the diff. Expanding aliases changes storage hashes without changing the database schema. Do not treat a signature mismatch as permission to reset a database. 5. Audit CI, redirects, command substitutions and agent wrappers. For JSON parsing, the release's exact replacement is prisma migration status --json | jq '.envelope.result'. For tab-separated data, its example is prisma migration list | cut -f2. Choose the interface deliberately. 6. Align a direct @prisma/cli-engine dependency with the required 0.9.0 (checked 2026-10-28). The engine integration PR explains that CLI and ORM release numbers differ; do not infer a matching CLI tag from an ORM tag. Check the lockfile for a conflicting engine pin.

What breaks

Diagnostic: PSL_GENERATOR_IN_DEFAULT

This is the official generator diagnostic. A client generator under @default is rejected. Keep database defaults intact when fixing it.

The typed-client PR also documents a compile failure for the removed contractJson option. Search the constructor and tests before changing application query logic. Stored aliases can prevent old contracts from loading. A piped command can now yield tab-separated values or empty stdout instead of JSON; parser failures are an expected consequence, but no universal parser error string is specified.

What to test

  • Compile application and test entry points after converting client setup; include any alternate facade your app actually uses.
  • On disposable fixtures, insert a record with an omitted generated ID and update a field using an update generator. Verify both generated and explicitly supplied values.
  • Review contract and snapshot diffs separately from schema changes. Check aliases and extension contracts rather than assuming the constructor edit completes the upgrade.
  • Capture stdout, stderr and exit status independently for every wrapper. Test a list with zero, one and several rows; test successful commands with empty stdout.
  • For JSON wrappers, check the actual emitted record structure instead of assuming that adding a flag fixes every downstream selector. Global output flags explain the stream split and explicit format selection.

Pitfalls

A blanket replacement of every @default changes the wrong semantics. An ORM RC number is not a CLI version pin. Empty stdout is not proof of failure. Hash changes and rewritten snapshots deserve review even when no table changes are required. This thread covers these two RC hops, not the entire major-version migration.

Implementation and community evidence

  • Prisma maintainer wmadden-electric's typed-client PR supplies the new constructor and the removed-option diagnostic.
  • The same maintainer's CLI integration PR explains the engine mismatch and demonstrates tabular versus JSON pipelines.

These are implementation records from one maintainer, not two independent adoption reports. Searches for the precise generator error and piped-output change did not establish independent production confirmation.

A prompt to give your agent

Your training data predates these changes. Read the linked official Prisma release notes, typed-client PR and global-flags page before editing; do not guess APIs or CLI tags. Inventory installed facades, toolchain and CLI. Prepare separate diffs for generator attributes, typed client construction, stored contracts and JSON-consuming scripts. Read the linked hop recipes before using a rewrite script. Include tests and identify signing steps for review; do not connect to a database or run signing, migrations or resets.

Limits

Checked 2026-10-28. No Prisma packages installed, scripts executed, contracts emitted or databases accessed. The recipe directories were blocked by the web fetcher, so their script filenames and invocation are deliberately unspecified; the steps above use fetched release notes and PR examples. Independent community evidence is thin. No licence or price comparison was needed.

Started from a post by @Prisma, 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.

# Prisma 8 rc.19/rc.20: how do I fix defaults and JSON?
Summary: As of October 2026, Prisma 8.0.0-rc.19 and 8.0.0-rc.20 (checked 2026-10-28) require explicit client generators, typed contract values and --json for JSON-consuming scripts; port the two RC hops in order and review contract rewrites before signing databases.
Copy for agent
get the whatworks thread prisma-8-rc19-rc20-default-contract-json-migration 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 prisma-8-rc19-rc20-default-contract-json-migration
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