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-engine0.6.3. A project or extension that pins@prisma/cli-engineitself must move the pin from0.6.2to0.6.3. The engine's commands and output do not change: its only change is that it accepts ArkType^2.2.7instead of exactly2.2.3. Seeengine-pin-moves-to-0-6-3in the app recipe and the extension recipe. (#30632) -
@defaultdiagnostics point at the written value and say what to write.PSL_VALUE_TYPE_INCOMPATIBLEandPSL_INVALID_LITERALfrom@defaultnow 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 reportsExpected a number; got a list, where it reportedpg/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. Seedefault-refusals-point-at-the-written-value,default-refusals-say-what-to-writeandfunction-call-arguments-keep-their-diagnosticsin the app recipe. (#30539) -
Extension authors: the stack's data types travel as one
dataTypespair.ControlStack,ContractSourceContext, the PSL interpreter inputs,SqlPslBuildContextandDefaultMappingOptionsreplacedataTypeLookupanddataTypeEntrieswithdataTypes: DataTypeSupport, and attribute spec contexts andcreateBindertakedataTypestoo.entryForTag,WrittenValueandDataTypeSupportmove to@internal/framework-components/authoring. A tagged literal's canonical value is its text:parseJsonBodyis nowparseJsonText, andTaggedLiteralExprAst.body()is nowtext(). See the extension recipe. (#30539)
Fixes
- With Bun,
prisma orm initandprisma contract emitno longer fail withCONTRACT.VALIDATION_FAILEDon a valid contract. Engine 0.6.3 and the Prisma ORM packages now resolve one ArkType copy. (#30632)