github prisma/orm v8.0.0-rc.16

pre-release3 hours ago

v8.0.0-rc.16

This release moves the toolchain to @prisma/cli-engine 0.6.3, which shares one ArkType copy with the Prisma ORM packages. With engine 0.6.2, a fresh Bun install could resolve two ArkType copies, and prisma orm init and prisma contract emit then failed on a valid contract. A @default that PSL refuses is now reported at the written value, with a message that says what to write instead.

The upgrade recipes for this hop: the app recipe and the extension recipe. Each breaking change below names the change id to look for in them.

Breaking changes

  • The toolchain requires @prisma/cli-engine 0.6.3. A project or extension that pins @prisma/cli-engine itself must move the pin from 0.6.2 to 0.6.3. The engine's commands and output do not change: its only change is that it accepts ArkType ^2.2.7 instead of exactly 2.2.3. See engine-pin-moves-to-0-6-3 in the app recipe and the extension recipe. (#30632)

  • @default diagnostics point at the written value and say what to write. PSL_VALUE_TYPE_INCOMPATIBLE and PSL_INVALID_LITERAL from @default now point at the written value, or at the list element they name, not at the whole attribute. A refusal starts with what to write instead: count Int @default([1]) now reports Expected a number; got a list, where it reported pg/int4 has no cast from a list; it casts from pg/int2. A wrong argument to a default function, such as @default(uuid(5)), is reported at that argument. The codes do not change, and schemas and contracts do not change; only code that asserts a diagnostic's text or location must change. See default-refusals-point-at-the-written-value, default-refusals-say-what-to-write and function-call-arguments-keep-their-diagnostics in the app recipe. (#30539)

  • Extension authors: the stack's data types travel as one dataTypes pair. ControlStack, ContractSourceContext, the PSL interpreter inputs, SqlPslBuildContext and DefaultMappingOptions replace dataTypeLookup and dataTypeEntries with dataTypes: DataTypeSupport, and attribute spec contexts and createBinder take dataTypes too. entryForTag, WrittenValue and DataTypeSupport move to @internal/framework-components/authoring. A tagged literal's canonical value is its text: parseJsonBody is now parseJsonText, and TaggedLiteralExprAst.body() is now text(). See the extension recipe. (#30539)

Fixes

  • With Bun, prisma orm init and prisma contract emit no longer fail with CONTRACT.VALIDATION_FAILED on a valid contract. Engine 0.6.3 and the Prisma ORM packages now resolve one ArkType copy. (#30632)

Don't miss a new orm release

NewReleases is sending notifications on new releases.