v8.0.0-rc.10
This RC finishes the rename from Prisma Next to Prisma 8 in every identifier a project can see (the old schema header keeps working, the old environment variables do not), adds named model and result types to the emitted contract, makes db sign set the db ref so the first plan after adoption stays incremental, and adds attribute completion to the language server.
Breaking changes
-
CLI environment variables lose the
NEXT_infix.PRISMA_NEXT_DISABLE_TELEMETRY,PRISMA_NEXT_TELEMETRY_ENDPOINT,PRISMA_NEXT_DEBUG, and the rest are nowPRISMA_DISABLE_TELEMETRY,PRISMA_TELEMETRY_ENDPOINT,PRISMA_DEBUG, and so on. Only the oldPRISMA_NEXT_DISABLE_TELEMETRYopt-out is still honoured; rename the others in shell profiles,.envfiles, and CI. The per-user telemetry config moves from~/.config/prisma-next/to~/.config/prisma-8/, so the one-time telemetry notice prints once more.orm initnow writes its primer asprisma-8.mdinstead ofprisma-next.md. See the app upgrade recipe. (#30262) -
To-one relations record their nullability in the contract. Every
1:1andN:1relation incontract.jsonnow carries anullableboolean taken from the?on the relation field, andcontract emitrejects a required relation field over a nullable foreign key (or the reverse). Runprisma contract emitonce after upgrading: a contract emitted by an earlier release still loads, with the flag derived from the foreign-key columns, but itscontract.d.tslacks the newModelsnamespace until you re-emit. Extension authors:ContractNonJunctionRelation's'1:1'and'N:1'members requirenullable, contract validation rejects acontract.jsonwithout it, and every contract space needs a rebuild. See the app upgrade recipe and the extension upgrade recipe. (#30231)Before:
{ "cardinality": "N:1", "on": { "...": "..." } }After:
{ "cardinality": "N:1", "nullable": false, "on": { "...": "..." } }
Features
-
The schema header is now
// use prisma-8, and// use prisma-nextis deprecated.orm initandcontract inferwrite the new header. The old one still works:contract emitnever reads the header, and the language server still recognises it and rewrites it to the new form when you format the file. Replace it at your convenience; the app upgrade recipe does it for you. (#30262) -
Named model and result types.
contract.d.tsexports aModelsnamespace and amodelsconstant with one member per model (Models.public_User, ortypeof models.public.User; bare names on SQLite).Scalars<M>names the row a default fetch returns,Shape<M, Spec>derives a data structure with chosen scalars and nested relations, andResultTypenow works on ORM queries instead of returningnever. Both come from@prisma/orm-postgres/family-contract/types(or the@prisma/orm-mongoequivalent). These replace Prisma 7'sPrisma.UserandUserGetPayload<...>. (#30231)import type { Models } from './prisma/contract'; import type { Scalars, Shape } from '@prisma/orm-postgres/family-contract/types'; import type { ResultType } from '@prisma/orm-postgres/components/runtime'; type UserRow = Scalars<Models.public_User>; type UserResponse = Shape<Models.public_User, { '-': 'passwordHash'; posts: { '+': 'id' | 'title' } }>; const usersWithPosts = db.orm.public.User.include('posts'); type UserWithPosts = ResultType<typeof usersWithPosts>;
-
Attribute completion in the language server. Editors now complete field, model, and block attribute names and their named argument keys from the installed target and extensions, and insert required arguments as editable snippets where the editor supports them. (#30249)
-
db signcan choose or skip the ref it advances.--advance-ref <name>writes another ref thandb,--no-advance-refsigns without writing any ref or snapshot, and--jsonoutput gainsadvancedRef: { name, hash }(ornull). (#30251)
Fixes
- After
db sign,migration planproposes only the change instead of recreating every table.db signnow sets thedbref to the signed contract, even when the database is named with--db, so adopting an existing database no longer needs a baseline plan, a second sign, and a manualmigration ref set. When no ref is set and no migrations exist,migration planprints a notice that it is planning from an empty database, and--jsongainsfromDefaulted: true. (#30251) - Buffered PostgreSQL queries release their pooled connection before rows are decoded or consumed, so a paused result iterator no longer holds a connection and blocks other queries on a small pool. Cursor streams keep their connection until completion; caller-owned connections and transactions are untouched. (#30259)
orm initinstallsprisma@latestinstead ofprisma@next, a dist-tag that no longer exists, so a freshorm initcompletes its install step again. The engine fallback is@prisma/cli-engine@latest. (#30248)- The bundled
prisma-8agent skill matches the rc.9 surface again: a review of every reference file corrected 21 statements that no longer matched the CLI or runtime, and the sample projects are keyed by namespace. (#30250)