prisma-8

Use when working in a project that depends on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo (Prisma 8, formerly Prisma Next): editing contract.prisma or a contract.ts builder, running `prisma contract emit`, planning or applying migrations, editing migration.ts, writing db.orm / db.sql / db.query queries, wiring db.ts or middleware, integrating a build tool, using the Supabase extension or RLS, or reading a dotted error code such as MIGRATION.HASH_MISMATCH. Use when the user asks "what is Prisma 8", "where do I start", or compares it to another ORM. Use when the user asks to upgrade or bump Prisma 8 in an app or an extension package. Use when you see @internal/* or @prisma/orm-* imports, prisma.config.ts with definePrismaConfig, or contract.json / contract.d.ts. Do not use for Prisma ORM 7 or earlier (schema.prisma + @prisma/client).

Install
npx skills add 'https://github.com/prisma/orm/tree/main/skills/prisma-8'
Download bundle ↓
main · fac8604Scanned 2026-09-17

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗

upgrading/app/upgrades/0.14-to-0.15/instructions.md

upgrading/app/upgrades/0.14-to-0.15/instructions.mdBrowse 76 files
View on GitHub
← Back to SKILL.md

from: "0.14" to: "0.15" changes:

  • id: sql-orm-includes-decode-codec-values summary: | SQL ORM includes now decode every scalar child field through its contract-bound codec, matching top-level query results. Update application code and tests that relied on included fields retaining the database's JSON representation: for example, Postgres bytea include fields now return Uint8Array instead of \\x-prefixed hex text, and timestamp include fields return Date instead of timestamp strings. Custom codec-backed include fields likewise return the value produced by the codec's decodeJson method.
  • id: db-verify-json-single-issue-list summary: | prisma-next db verify --json (and db verify --schema-only --json) now report a single schema.issues array instead of the split schema.issues / schema.schemaDiffIssues pair — the one-differ-two-ir-planner slice unified the CLI's schema-issue vocabulary onto one shape: { path, reason, message, expected?, actual? }. reason replaces the retired outcome field ('missing' -> 'not-found', 'extra' -> 'not-expected', 'mismatch' -> 'not-equal'). The same collapse applies to schema.warnings. If a script or CI step parses db verify --json output and reads schema.schemaDiffIssues / schema.warnings.schemaDiffIssues, or compares an issue's .outcome field, update it: read schema.issues (it already carries everything the two lists used to, concatenated) and switch any .outcome comparison to the matching .reason value. detection: glob: "**/*.{ts,mts,cts,js,mjs,sh}" contains: - "schemaDiffIssues" - ".outcome === 'missing'" - ".outcome === 'extra'" - ".outcome === 'mismatch'" anyMatch: true
  • id: policy-target-models-require-rls-attribute summary: | RLS enablement is now an explicit, authored table attribute: a policy_select block's target model must declare @@rls, or prisma-next contract emit fails with PSL_EXTENSION_TARGET_MODEL_MISSING_ATTRIBUTE naming the model and the policy. Add @@rls to every policy-bearing model and re-run prisma-next contract emit; the re-emitted contract.json gains an rls marker entity and a new storage hash. Plan semantics follow the marker, not the policy set: a marked table with RLS off plans ENABLE ROW LEVEL SECURITY (even with policies in sync), removing every policy keeps RLS enabled (fail-closed deny-all), removing @@rls itself plans DISABLE ROW LEVEL SECURITY (requires the destructive allowance), and changing only a policy's name prefix plans a single ALTER POLICY ... RENAME TO instead of drop+create. detection: glob: "**/*.prisma" contains: - "policy_select" anyMatch: true

Upgrade 0.14 → 0.15

No consumer-facing action is required for this transition.

The diff under examples/ (and the example migration snapshots) is incidental — emitted contract artefacts (contract.json / contract.d.ts) were regenerated for two internal substrate changes:

  • Scalar-list storage machinery. The emitted contracts now carry the adapter-reported scalarList capability marker and the bumped envelope version. The scalar-list machinery threaded through this release is internal — no authoring path emits a list storage column yet, so generated types and runtime behaviour for existing schemas are unchanged.
  • Namespace-scoped execution-default refs (M:N). The contract's ExecutionMutationDefault.ref now carries a namespace alongside table and column, so an execution-time mutation default is keyed by (namespace, table, column), disambiguating same-named tables across namespaces. The runtime applies defaults by namespace transparently.

No user action — a re-emit picks up the new contract shape.