[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-prisma-prisma-next-contract":3,"mdc-lad8nd-key":35,"related-org-prisma-prisma-next-contract":5728,"related-repo-prisma-prisma-next-contract":5882},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":31,"sourceUrl":33,"mdContent":34},"prisma-next-contract","edit Prisma Next data contracts and models","Edit the Prisma Next data contract — add models, fields, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` \u002F `@@base`), use extension namespaces (`pgvector.Vector(...)`, `cipherstash.EncryptedString(...)`), wire `prisma-next.config.ts` with `defineConfig` from the `@prisma-next\u002F\u003Ctarget>\u002Fconfig` façade, and run `prisma-next contract emit`. Use for schema, models, fields, attributes, soft delete, paranoid, scopes, validations, callbacks, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, `@prisma-next\u002Fpostgres\u002Fconfig`, `@prisma-next\u002Fpostgres\u002Fcontract-builder`, `@prisma-next\u002Fpostgres\u002Fcontrol`, `@prisma-next\u002Fmongo\u002Fconfig`, `@prisma-next\u002Fmongo\u002Fcontract-builder`, `extensions:`, pgvector, cipherstash, postgis, paradedb, supabase, `@prisma-next\u002Fextension-supabase`, `@@control`, control policy, managed, tolerated, external, observed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"prisma","Prisma","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fprisma.png",[12,16,19,22],{"name":13,"slug":14,"type":15},"TypeScript","typescript","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":20,"slug":21,"type":15},"Data Modeling","data-modeling",{"name":9,"slug":8,"type":15},415,"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-next","2026-07-30T05:30:10.426962",null,15,[29,30],"loggy-core","loggy-terminal",{"repoUrl":24,"stars":23,"forks":27,"topics":32,"description":26},[29,30],"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fprisma-next\u002Ftree\u002FHEAD\u002Fskills\u002Fprisma-next-contract","---\nname: prisma-next-contract\ndescription: Edit the Prisma Next data contract — add models, fields, relations, indexes, enums, value objects (composite types), type aliases, namespaces (Postgres schemas), cross-contract foreign keys (cross-space FK), polymorphic types (`@@discriminator` \u002F `@@base`), use extension namespaces (`pgvector.Vector(...)`, `cipherstash.EncryptedString(...)`), wire `prisma-next.config.ts` with `defineConfig` from the `@prisma-next\u002F\u003Ctarget>\u002Fconfig` façade, and run `prisma-next contract emit`. Use for schema, models, fields, attributes, soft delete, paranoid, scopes, validations, callbacks, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, `@prisma-next\u002Fpostgres\u002Fconfig`, `@prisma-next\u002Fpostgres\u002Fcontract-builder`, `@prisma-next\u002Fpostgres\u002Fcontrol`, `@prisma-next\u002Fmongo\u002Fconfig`, `@prisma-next\u002Fmongo\u002Fcontract-builder`, `extensions:`, pgvector, cipherstash, postgis, paradedb, supabase, `@prisma-next\u002Fextension-supabase`, `@@control`, control policy, managed, tolerated, external, observed.\n---\n\n# Prisma Next — Contract Authoring\n\n> **Edit your data contract. Prisma handles the rest.**\n\nThe data contract is the single source of truth for your data layer. You edit a contract source — `contract.prisma` (PSL, the canonical surface) or `contract.ts` (TypeScript builder) — and the framework derives types, migrations, and runtime configuration from it. The three-step user model:\n\n1. **You edit your data contract.**\n2. **The system plans the migrations for you.** (`prisma-next-migrations`)\n3. **If you need data migrations, you edit `migration.ts` and execute it.** (`prisma-next-migrations`)\n\nBehind step 1 the agent runs `prisma-next contract emit` after every contract edit (or installs the Vite plugin so the bundler runs it on save — see `prisma-next-build`). Emit reads the contract source through the provider the façade picks based on the file extension of `contract:` in `prisma-next.config.ts`, then writes two artefacts colocated with the source:\n\n- `contract.json` — the canonical, content-hashed Contract IR. Read by the planner, the runtime, and `db verify`.\n- `contract.d.ts` — the precise TypeScript types the runtime + lanes propagate when you import `Contract` from it.\n\nBoth files are **emitted artefacts**. Edit the source; never the JSON or `.d.ts`.\n\n## When to Use\n\n- User wants to add, change, or remove a model \u002F field \u002F relation.\n- User wants to add an index, unique constraint, enum, or value object (composite type).\n- User wants to add a namespace block (Postgres schema) or a cross-contract foreign key.\n- User wants to set `@@control` on a model or configure `defaultControlPolicy`.\n- User wants to use a custom type from an extension (`pgvector.Vector(length: 1536)`, `cipherstash.EncryptedString({...})`).\n- User wants to install or configure an extension via `extensions: [...]` in `prisma-next.config.ts`, including `@prisma-next\u002Fextension-supabase`.\n- User is migrating between authoring sources (PSL ↔ TypeScript builder).\n- User received `PN-CLI-4002`, `PN-CLI-4003`, or `PN-CLI-4011` from `contract emit`.\n- User mentions: *schema, fields, models, attributes, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, contract emit, façade imports, `@prisma-next\u002Fpostgres\u002Fconfig`, `@prisma-next\u002Fpostgres\u002Fcontract-builder`, extensions, pgvector, cipherstash, postgis, paradedb, supabase, namespaces, cross-space FK, `@@control`, enums, value objects, validations, callbacks, soft delete, paranoid, scopes*. (The last cluster routes to *What Prisma Next doesn't do yet* below.)\n\n## When Not to Use\n\n- User wants to apply a contract change to the DB → `prisma-next-migrations`.\n- User wants to write a query against the contract → `prisma-next-queries`.\n- User wants to wire `db.ts` (runtime entry point, middleware, env config) → `prisma-next-runtime`.\n- User wants the Vite \u002F bundler integration → `prisma-next-build`.\n- User wants to set up Prisma Next for the first time → `prisma-next-quickstart`.\n- User wants a deeper read of a single structured error envelope → `prisma-next-debug`.\n- User wants to file a missing-feature request → `prisma-next-feedback`.\n\n## Key Concepts\n\n- **The `@prisma-next\u002F\u003Ctarget>` façade is the only surface user-authored code imports from.** For a Postgres app: `@prisma-next\u002Fpostgres\u002Fconfig`, `@prisma-next\u002Fpostgres\u002Fcontract-builder`, `@prisma-next\u002Fpostgres\u002Fcontrol`, `@prisma-next\u002Fpostgres\u002Fruntime`. Mongo has the same layout (`@prisma-next\u002Fmongo\u002Fconfig`, `@prisma-next\u002Fmongo\u002Fcontract-builder`, `@prisma-next\u002Fmongo\u002Fruntime`). Each extension publishes its own façade — `@prisma-next\u002Fextension-pgvector\u002Fcontrol`, `@prisma-next\u002Fextension-postgis\u002Fcontrol`, `@prisma-next\u002Fextension-paradedb\u002Fcontrol`. **Never reach into `@prisma-next\u002Fcli\u002F*`, `@prisma-next\u002Ffamily-*`, `@prisma-next\u002Ftarget-*`, `@prisma-next\u002Fadapter-*`, `@prisma-next\u002Fdriver-*`, or `@prisma-next\u002Fsql-contract-*` from user code.** The façade bakes the family \u002F target \u002F adapter \u002F driver wiring in. See *Common Pitfalls* #4.\n- **Contract source.** A file the framework reads and lowers to the canonical Contract IR. Two flavours, both first-class:\n  - **`contract.prisma` (PSL)** — schema-flavoured DSL. Canonical for typical apps and brownfield Prisma users. Wired by `contract: '.\u002F\u003Cpath>\u002Fcontract.prisma'` — the `defineConfig` façade detects the `.prisma` extension and routes through the PSL provider.\n  - **`contract.ts` (TypeScript builder)** — programmatic authoring with `defineContract({...}, ({ field, model, rel, type }) => ({...}))` from `@prisma-next\u002Fpostgres\u002Fcontract-builder` (or `@prisma-next\u002Fmongo\u002Fcontract-builder`). Wired by `contract: '.\u002F\u003Cpath>\u002Fcontract.ts'` — the façade detects the `.ts` extension and routes through the TS provider. Use when you need programmatic composition (per-tenant variants, generated fields) or constructs PSL doesn't yet express (e.g. registering a parameterised extension type — see pgvector's contract).\n- **`prisma-next.config.ts`.** Wires the contract source, the database connection, the migrations directory, and any installed extensions. Use `defineConfig({...})` from `@prisma-next\u002Fpostgres\u002Fconfig` (or `@prisma-next\u002Fmongo\u002Fconfig`). The four fields the façade accepts: `contract` (path string — `.prisma` or `.ts`), `db` (`{ connection?: string }`), `extensions` (array of control descriptors), `migrations` (`{ dir?: string }`). The output path for `contract.json` is auto-derived from `contract` (e.g. `.\u002Fsrc\u002Fprisma\u002Fcontract.prisma` → `.\u002Fsrc\u002Fprisma\u002Fcontract.json`).\n- **Emit pipeline.** `prisma-next contract emit --config \u003Cpath>?` reads `prisma-next.config.ts`, calls the provider the façade picked, validates the resulting Contract, then atomically writes `contract.json` + `contract.d.ts` colocated with the source.\n- **Extension namespaces.** Extensions contribute namespaced constructors (`pgvector.Vector(length: 1536)`, `cipherstash.EncryptedString({equality: true})`) and helper presets. Install them by adding the descriptor to **two** places — both fields are named `extensions`, but the two surfaces consume two different descriptor types and shapes:\n  - **In the config (façade and core):** `extensions: [pgvector]` — array of *control* descriptors imported from `@prisma-next\u002Fextension-\u003Cname>\u002Fcontrol`.\n  - **In the TS builder's `defineContract` (only when authoring `contract.ts`):** `extensions: { pgvector }` — record of *pack* descriptors imported from `@prisma-next\u002Fextension-\u003Cname>\u002Fpack`.\n- **Contract space.** Every package that emits a contract owns its own *contract space* — a `prisma-next.config.ts` at package root, a contract source, the colocated emitted artefacts, and a `migrations\u002F` directory. **There are two intentional on-disk layouts**, picked by whether the contract space is the consuming application or a contract-space package (an extension, an internal aggregate-root package, etc.):\n  - **Application layout** (what you use when building an *app*). `prisma-next.config.ts` at repo root; `src\u002Fprisma\u002Fcontract.{prisma,ts}`; `src\u002Fprisma\u002Fcontract.{json,d.ts}` colocated; `src\u002Fprisma\u002Fdb.ts` colocated; migrations under `migrations\u002Fapp\u002F\u003Ctimestamp>_\u003Cslug>\u002F`. The `app\u002F` segment is the consuming application's space-id; extension space-ids land in sibling `migrations\u002F\u003Cextension-space-id>\u002F` directories that the extension packages manage. This is what `examples\u002Fprisma-next-demo` uses. `prisma-next init` currently scaffolds something different (`prisma\u002F...` at repo root) — that's a defect (TML-2532); the canonical layout is what every command actually expects to see.\n  - **Contract-space-package layout** (what you use when *publishing* a contract-space package — extensions, internal monorepo packages). `prisma-next.config.ts` at package root; `src\u002Fcontract.{prisma,ts}` directly (no `prisma\u002F` subdir); `src\u002Fcontract.{json,d.ts}` colocated; `migrations\u002F\u003Ctimestamp>_\u003Cslug>\u002F` directly under `migrations\u002F` (no `\u003Cspace-id>` segment — the package *is* a single space). Documented in `.cursor\u002Frules\u002Fcontract-space-package-layout.mdc` and ADR 212.\n\n  Both layouts let `defineConfig`'s `contract:` path point at the source; the framework derives everything else (emit output, migration root) from there. Pick the layout that matches what you're building and stick with it — don't mix.\n\n## Diagnostic codes you route on\n\n`prisma-next contract emit` surfaces structured errors with stable codes; branch on `code` rather than message text.\n\n| Code | Meaning | Next move |\n|---|---|---|\n| `PN-CLI-4002` *Contract configuration missing* | `contract` not set in `prisma-next.config.ts`. | Add `contract: '.\u002Fsrc\u002Fprisma\u002Fcontract.prisma'` (app layout) or `'.\u002Fsrc\u002Fcontract.prisma'` (contract-space-package layout) — likewise for `.ts` sources — to `defineConfig({...})` from `@prisma-next\u002Fpostgres\u002Fconfig`. |\n| `PN-CLI-4003` *Contract validation failed* | Source loaded but the Contract IR failed structural validation. | Read `meta.diagnostics` \u002F `meta.issues` for the offending model\u002Ffield, fix the source, re-emit. |\n| `PN-CLI-4011` *Missing extension packs in config* | The contract uses a namespaced constructor (e.g. `pgvector.Vector(...)`) but `extensions` in the config does not list a matching descriptor. `meta.missingExtensions` names them. | Install the package, import its control descriptor (`import pgvector from '@prisma-next\u002Fextension-pgvector\u002Fcontrol'`), add it to `extensions: [...]` in `prisma-next.config.ts`. |\n\n## Workflow — Read the contract source of truth\n\nThe concept: every contract change starts by locating the source file. The config is authoritative — read `prisma-next.config.ts`, find the `contract:` field (a path string under the façade), and open the file it points at. The same field tells you the installed `extensions: [...]`.\n\n```bash\ncat prisma-next.config.ts\n```\n\nIf `contract:` ends in `.prisma`, the source is PSL; if it ends in `.ts`, the source is the TS builder. If `prisma-next.config.ts` is missing, route to `prisma-next-quickstart`.\n\n## Workflow — Edit a model \u002F field \u002F relation (PSL)\n\nThe concept: PSL models lower to tables (or collections, on Mongo); fields lower to columns; `@relation(...)` declares the FK side. Add the relation only on the owning side — the framework derives the back-reference automatically.\n\n```prisma\nmodel User {\n  id    Int    @id @default(autoincrement())\n  email String @unique\n}\n\nmodel Post {\n  id       Int    @id @default(autoincrement())\n  title    String\n  authorId Int\n  author   User   @relation(fields: [authorId], references: [id], onDelete: Cascade)\n\n  @@unique([title, authorId])\n  @@index([authorId])\n}\n```\n\nThen run `pnpm prisma-next contract emit` (or rely on the Vite plugin — see `prisma-next-build`). Specify cascade behaviour explicitly with `onDelete` \u002F `onUpdate`; the default is `Restrict`.\n\n`@@index` also accepts `expression:` (instead of a fields list), `where:` (partial-index predicate), `unique:`, `type:`\u002F`options:` (target-registered access method), and `name:` xor `map:`:\n\n```prisma\n@@index(expression: \"lower(email)\", name: \"users_email_lower\")\n@@index([authorId], where: \"(archived_at IS NULL)\", name: \"posts_author_active\")\n```\n\n`name:` declares a managed index (physical name `\u003Cname>_\u003C8-hex hash>`, renames plan as `ALTER INDEX … RENAME`); `map:` adopts an exact physical name verbatim (for infer-captured objects — combining it with a SQL body warns, because drift detection byte-compares the authored text against Postgres's reprint). An `expression:` requires `name:` or `map:`. The TS builder mirrors this via `constraints.index([cols.x], {...})` \u002F `constraints.index({ expression, ... })` — see `packages\u002F2-sql\u002F2-authoring\u002Fcontract-ts\u002FREADME.md`.\n\nPSL alias surface for repeated types lives in a top-level `types {}` block:\n\n```prisma\ntypes {\n  Email = String\n}\n\nmodel User {\n  id    Int    @id @default(autoincrement())\n  email Email  @unique\n}\n```\n\nNote: scalar lists (e.g. `String[]`) and implicit Prisma-ORM many-to-many (list nav on both sides without a join model) are rejected by the SQL interpreter — use a join model. Composite\u002Fembeddable types (`type Address { ... }` with `address Address` on a model) are supported: the interpreter lowers them to `valueObjects` in the domain and stores them as `jsonb` columns. See *Workflow — Value objects* below.\n\n## Workflow — Edit a model \u002F field \u002F relation (TS builder)\n\nThe concept: same model, different authoring surface. The façade re-exports `defineContract`, `field`, `model`, `rel`, plus the `family`\u002F`target` packs as default exports of `@prisma-next\u002Fpostgres\u002Ffamily` and `@prisma-next\u002Fpostgres\u002Ftarget`. Use the callback overload (`defineContract({...}, ({ field, model, rel, type }) => ({...}))`) to get the higher-level helpers (`field.text()`, `field.id.uuidv7String()`, `field.temporal.createdAt()`, `type.sql.String(35)`).\n\n```typescript\nimport sqlFamily from '@prisma-next\u002Fpostgres\u002Ffamily';\nimport { defineContract } from '@prisma-next\u002Fpostgres\u002Fcontract-builder';\nimport postgresPack from '@prisma-next\u002Fpostgres\u002Ftarget';\n\nexport const contract = defineContract(\n  {\n    family: sqlFamily,\n    target: postgresPack,\n  },\n  ({ field, model }) => ({\n    models: {\n      User: model('User', {\n        fields: {\n          id: field.id.uuidv7String(),\n          email: field.text().unique(),\n          createdAt: field.temporal.createdAt(),\n        },\n      }).sql({ table: 'app_user' }),\n    },\n  }),\n);\n```\n\nThen `pnpm prisma-next contract emit`. The `field.\u003Cscalar>()` helpers are only available inside the callback overload; outside the callback only `field.column(...)`, `field.generated(...)`, `field.namedType(...)` exist.\n\nFor Mongo, swap every `@prisma-next\u002Fpostgres\u002F*` import for `@prisma-next\u002Fmongo\u002F*`. The Mongo builder also exposes `index` and `valueObject`.\n\n## Workflow — Add an extension-typed scalar (pgvector)\n\nThe concept: an extension contributes a namespace (`pgvector.*`) plus two descriptor flavours — a *control* descriptor for the config façade and a *pack* descriptor for the TS builder. Register the control descriptor in `defineConfig.extensions` (array form). If you're authoring with the TS builder, also register the pack descriptor in `defineContract.extensions` (record form). Then reference the namespaced constructor from the contract.\n\n`prisma-next.config.ts`:\n\n```typescript\nimport pgvector from '@prisma-next\u002Fextension-pgvector\u002Fcontrol';\nimport { defineConfig } from '@prisma-next\u002Fpostgres\u002Fconfig';\n\nexport default defineConfig({\n  contract: '.\u002Fsrc\u002Fprisma\u002Fcontract.prisma',\n  extensions: [pgvector],\n});\n```\n\n`src\u002Fprisma\u002Fcontract.prisma`:\n\n```prisma\nmodel Document {\n  id        Int                          @id @default(autoincrement())\n  content   String\n  embedding pgvector.Vector(length: 1536)\n}\n```\n\nEmit. The named-type lowering puts `vector(1536)` on the column and the type map in `contract.d.ts` carries the right TS type.\n\nIf you reference `pgvector.*` without registering the pack in the config, emit fails with `PN-CLI-4011` and `meta.missingExtensions: ['pgvector']`. The envelope's `fix` text says *\"Add the missing extension descriptors to `extensions` in prisma-next.config.ts\"* — that field name matches the façade.\n\nFor canonical worked examples covering single and multi-extension setups, read `examples\u002Fmulti-extension-monorepo\u002Fapp\u002Fprisma-next.config.ts` and `examples\u002Fprisma-next-postgis-demo\u002Fprisma-next.config.ts`.\n\n## Workflow — Polymorphism (`@@discriminator` \u002F `@@base`)\n\nThe concept (SQL targets): one base model declares the discriminator field; each variant model declares its base + discriminator value. The variant chooses STI vs MTI by **whether it sets `@@map(...)`**: no `@@map` means the variant inherits the base's table (single-table inheritance); `@@map(\"variant_table\")` means the variant gets its own table joined 1:1 by primary key (multi-table inheritance).\n\n```prisma\nmodel Task {\n  id    Int    @id @default(autoincrement())\n  title String\n  type  String\n\n  @@discriminator(type)\n  @@map(\"tasks\")\n}\n\n\u002F\u002F STI variant — shares the `tasks` table.\nmodel Bug {\n  severity String\n\n  @@base(Task, \"bug\")\n}\n\n\u002F\u002F MTI variant — joins to `tasks` via PK; carries its own `features` table.\nmodel Feature {\n  priority Int\n\n  @@base(Task, \"feature\")\n  @@map(\"features\")\n}\n```\n\nVerify the polymorphism syntax against the interpreter tests if in doubt: `packages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002Ftest\u002Finterpreter.polymorphism.test.ts`.\n\nMongo has no schema layer, so polymorphism on Mongo is modelled by an explicit `discriminator` field on the model in the TS builder (see `@prisma-next\u002Fmongo\u002Fcontract-builder`); `@@base` \u002F `@@discriminator` PSL attributes are SQL-only.\n\nQuerying the variants is a runtime concern — see `prisma-next-queries`.\n\n## Workflow — Value objects (composite types)\n\nThe concept: `type Foo { ... }` blocks declare value-object shapes. The interpreter lowers them to `valueObjects` in the contract domain and stores them as `jsonb` columns. Nested value-object references are supported.\n\n```prisma\ntype Address {\n  street  String\n  city    String\n  zip     String?\n  country String\n}\n\nmodel User {\n  id      String   @id @default(uuid())\n  email   String\n  address Address?\n}\n```\n\nEmitted `contract.json` carries `domain.namespaces.\u003Cns>.valueObjects.Address` with its field descriptors, and the `address` column lands as `codecId: \"pg\u002Fjsonb@1\"` \u002F `nativeType: \"jsonb\"` in `storage`.\n\nCanonical worked example: `examples\u002Fprisma-next-demo\u002Fsrc\u002Fprisma\u002Fcontract.prisma`.\n\n## Workflow — Enums\n\nThe concept: PSL `enum` blocks declare a domain enum: a named value-set stored through a declared codec (`@@type(\"pg\u002Ftext@1\")` → a `text` column) and enforced by a planner-generated CHECK constraint. Each member maps to its database value with `Name = \"value\"`. Use the enum name as a field type on any model in the same contract.\n\n```prisma\nenum user_type {\n  @@type(\"pg\u002Ftext@1\")\n  admin = \"admin\"\n  user  = \"user\"\n}\n\nmodel User {\n  id   String    @id @default(uuid())\n  kind user_type\n}\n```\n\nCanonical worked example: `examples\u002Fprisma-next-demo\u002Fsrc\u002Fprisma\u002Fcontract.prisma`.\n\n## Workflow — Namespaces (Postgres schemas)\n\nThe concept: wrap models in a `namespace \u003Cname> { ... }` block to place them in a non-default Postgres schema. Models outside any block go into the implicit default namespace.\n\n```prisma\nnamespace public {\n  model Profile {\n    id       String @id @default(uuid())\n    username String\n    userId   String @unique\n    @@map(\"profile\")\n  }\n}\n```\n\nCanonical worked example: `examples\u002Fsupabase\u002Fsrc\u002Fcontract.prisma`.\n\n## Workflow — Cross-contract foreign keys\n\nThe concept: a relation field can reference a model in another contract space using the `\u003Cspace>:\u003Cnamespace>.\u003CModel>` form. The contract also supports top-level named-type aliases in a `types {}` block, backed by the same bare type-position constructors used by fields. The `@db.X(args)` channel is removed: rewrite `@db.X` as `X` and `@db.X(args)` as `X(args)`; remaining uses fail with an actionable diagnostic naming the replacement.\n\n```prisma\ntypes {\n  AuthUserId = Uuid\n}\n\nnamespace public {\n  model Profile {\n    id       String     @id @default(uuid())\n    username String\n    userId   AuthUserId @unique\n    user     supabase:auth.AuthUser @relation(fields: [userId], references: [id], onDelete: Cascade)\n    @@map(\"profile\")\n  }\n}\n```\n\n`supabase:auth.AuthUser` means: model `AuthUser` in namespace `auth` of contract space `supabase`. The target space is provided by a registered extension pack (here `@prisma-next\u002Fextension-supabase\u002Fpack`).\n\nCanonical worked example: `examples\u002Fsupabase\u002Fsrc\u002Fcontract.prisma`.\n\n## Workflow — `@@control` (control policy)\n\nThe concept: `@@control(\u003Cpolicy>)` on a model sets whether Prisma manages that table's DDL in migrations. The argument is a positional lowercase literal — one of `managed`, `tolerated`, `external`, or `observed`.\n\n```prisma\nmodel AuditLog {\n  id        Int    @id\n  message   String\n\n  @@control(observed)\n}\n```\n\nA contract-level default can be set via `defaultControlPolicy` on `prismaContract(path, { defaultControlPolicy })`. See `prisma-next-migrations` for how control policies affect DDL planning.\n\n## Workflow — `@prisma-next\u002Fextension-supabase`\n\nThe concept: the Supabase extension provides the `supabase` contract space (the `auth` \u002F `storage` schemas as `external` tables, plus the platform roles) and its own role-first runtime factory. It does not expose a `\u002Fcontrol` subpath so it cannot be registered via the user-facing `defineConfig({ extensions: [...] })` façade — it is wired via `extensions` in the low-level config. See `examples\u002Fsupabase` for the full working pattern.\n\n`prisma-next.config.ts` (mirrors the example):\n\n```typescript\nimport supabasePack from '@prisma-next\u002Fextension-supabase\u002Fpack';\nimport { defineConfig } from '@prisma-next\u002Fcli\u002Fconfig-types';\n\u002F\u002F ... other low-level imports\n\nexport default defineConfig({\n  \u002F\u002F ...\n  extensions: [supabasePack],\n});\n```\n\n`db.ts` does **not** use the stock `postgres()` factory — a Supabase app builds its client with the `supabase()` factory from `@prisma-next\u002Fextension-supabase\u002Fruntime` (role-first: `asUser(jwt)` \u002F `asAnon()` \u002F `asServiceRole()`, JWT validation, RLS). That runtime — and RLS policy authoring (`policy_select` \u002F `@@rls`) — is covered by **`prisma-next-supabase`**; load it for anything past the config wiring.\n\nExport subpaths: `@prisma-next\u002Fextension-supabase\u002Fpack`, `@prisma-next\u002Fextension-supabase\u002Fruntime`, `@prisma-next\u002Fextension-supabase\u002Fcontract`. Canonical worked example: `examples\u002Fsupabase`.\n\n## Workflow — Brownfield introspection\n\nThe concept: pull a contract source out of an existing database and continue from there. `prisma-next contract infer --db \u003Curl>` reads the live schema and writes a `contract.prisma` file. It stops there — follow it with `contract emit` and (when the schema matches a pinned hash) `db sign` as separate steps.\n\n```bash\npnpm prisma-next contract infer --db $DATABASE_URL --output .\u002Fsrc\u002Fprisma\u002Fcontract.prisma\npnpm prisma-next contract emit\n```\n\n## Common Pitfalls\n\n1. **Forgetting to re-emit after an edit.** `contract.json` and `contract.d.ts` go stale; downstream typecheck and `migration plan` see the old shape. Re-emit, or install the Vite plugin (`prisma-next-build`).\n2. **Editing the emitted artefacts.** `contract.json` and `contract.d.ts` are emitted; edits there round-trip away on the next emit. Edit the source.\n3. **Wrong factory\u002Fimport path for the TS builder.** `defineContract`, `field`, `model`, `rel` come from `@prisma-next\u002Fpostgres\u002Fcontract-builder` (or `@prisma-next\u002Fmongo\u002Fcontract-builder`). Outside the callback overload, the available field constructors are `field.column(...)`, `field.generated(...)`, `field.namedType(...)`.\n4. **Reaching into internal packages from user code.** User-authored files (`prisma-next.config.ts`, `contract.ts`, `db.ts`, control clients) import only from `@prisma-next\u002F\u003Ctarget>\u002F\u003Csubpath>` and `@prisma-next\u002Fextension-\u003Cname>\u002F\u003Csubpath>`. Imports from `@prisma-next\u002Fcli\u002F*`, `@prisma-next\u002Ffamily-*`, `@prisma-next\u002Ftarget-*`, `@prisma-next\u002Fadapter-*`, `@prisma-next\u002Fdriver-*`, or `@prisma-next\u002Fsql-contract-*` are framework-internal — the façade composes them for you. If a façade subpath you need is missing for your target, see *What Prisma Next doesn't do yet* and route to `prisma-next-feedback`. The canonical worked examples are `examples\u002Fmulti-extension-monorepo\u002Fapp\u002Fprisma-next.config.ts` and `examples\u002Fprisma-next-postgis-demo\u002Fprisma-next.config.ts`.\n5. **Confusing the config `extensions` with the TS builder's `extensions`.** Same packs, two surfaces, one field name but two shapes: `defineConfig({ extensions: [pgvector] })` (array of *control* descriptors from `@prisma-next\u002Fextension-\u003Cname>\u002Fcontrol`) versus `defineContract({ extensions: { pgvector } })` (record of *pack* descriptors from `@prisma-next\u002Fextension-\u003Cname>\u002Fpack`).\n6. **Renaming a field and expecting the planner to detect it.** Prisma Next has no in-contract rename hint; the planner sees a destructive drop+add. Hand-edit `migration.ts` after `migration plan` (see `prisma-next-migrations`), or use the keep-then-drop two-migration pattern.\n\n## What Prisma Next doesn't do yet\n\n- **In-contract rename hint.** No `@@rename(old: ..., new: ...)` or similar. Use the workarounds in *Common Pitfalls* #6. To request first-class rename, file via `prisma-next-feedback`.\n- **Model validations.** No declarative `@validates(...)` surface. Validate in application code (arktype). To request declarative validations in the contract, file via `prisma-next-feedback`.\n- **Lifecycle callbacks** (`beforeSave`, `afterCreate`, etc.). Not supported. Use middleware (`prisma-next-runtime`) or app code. To request lifecycle callbacks, file via `prisma-next-feedback`.\n- **Soft delete \u002F `paranoid: true`.** No built-in soft-delete column. Add a nullable `deletedAt DateTime?` and filter explicitly in queries (or in middleware). To request built-in soft delete, file via `prisma-next-feedback`.\n- **Scopes \u002F default filters.** No ActiveRecord-style scopes. Compose query helpers yourself. To request scopes, file via `prisma-next-feedback`.\n- **Implicit Prisma-ORM many-to-many.** List navigation on both sides without an explicit join model is rejected. Author the join model explicitly. To request implicit M2M, file via `prisma-next-feedback`.\n\n## Reference\n\n- Run `pnpm prisma-next contract --help` for the live command surface.\n- PSL feature surface and what the interpreter accepts: `packages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002FREADME.md`.\n- TS builder surface and the callback-helper vocabulary: `packages\u002F2-sql\u002F2-authoring\u002Fcontract-ts\u002FREADME.md`.\n- Layouts (where `contract.prisma`, `contract.json`, `contract.d.ts`, and `migrations\u002F` live):\n  - **App layout** (`src\u002Fprisma\u002F...` + `migrations\u002Fapp\u002F...`) — what `examples\u002Fprisma-next-demo` demonstrates; the canonical shape consuming applications use.\n  - **Contract-space-package layout** (`src\u002Fcontract.{prisma,ts}` directly, `migrations\u002F\u003Ctimestamp>_\u003Cslug>\u002F` without a space-id segment) — for extensions and aggregate-root packages, documented in `.cursor\u002Frules\u002Fcontract-space-package-layout.mdc` and ADR 212.\n\n## Checklist\n\n- [ ] Read `prisma-next.config.ts` and identified the contract source (path string ending in `.prisma` or `.ts`) and the installed `extensions: [...]`.\n- [ ] All user-authored imports resolve to `@prisma-next\u002F\u003Ctarget>\u002F\u003Csubpath>` (e.g. `@prisma-next\u002Fpostgres\u002Fconfig`) or `@prisma-next\u002Fextension-\u003Cname>\u002F\u003Csubpath>`. No imports from `@prisma-next\u002Fcli\u002F*`, `@prisma-next\u002Ffamily-*`, `@prisma-next\u002Ftarget-*`, `@prisma-next\u002Fadapter-*`, `@prisma-next\u002Fdriver-*`, or `@prisma-next\u002Fsql-contract-*` in user files.\n- [ ] Edited the contract source (`contract.prisma` or `contract.ts`), not an emitted artefact.\n- [ ] For new extension namespaces: added the package, imported its control descriptor (`@prisma-next\u002Fextension-\u003Cname>\u002Fcontrol`), added it to `extensions: [...]` in `defineConfig({...})` (and the matching pack descriptor to `defineContract({extensions: {...}})` if using the TS builder).\n- [ ] For renames: hand-edited `migration.ts` after `migration plan` (or used the keep-then-drop two-migration pattern) — Prisma Next has no rename hint today.\n- [ ] Ran `pnpm prisma-next contract emit` after the edit (or let the Vite plugin re-emit on save).\n- [ ] Confirmed `contract.json` and `contract.d.ts` updated next to the source.\n- [ ] Did **not** hand-edit `contract.json` \u002F `contract.d.ts`.\n- [ ] Did **not** confabulate a missing feature (validations, callbacks, soft delete, scopes, in-contract rename hint) — referred the user to *What Prisma Next doesn't do yet* + `prisma-next-feedback`.\n",{"data":36,"body":37},{"name":4,"description":6},{"type":38,"children":39},"root",[40,49,63,85,139,176,218,237,244,411,417,510,516,1290,1296,1313,1532,1538,1563,1592,1631,1637,1650,1782,1824,1890,1913,1988,2001,2067,2119,2125,2224,2809,2850,2885,2891,2932,2941,3116,3126,3172,3192,3240,3259,3279,3313,3497,3509,3541,3552,3558,3585,3684,3733,3745,3751,3787,3870,3880,3886,3899,3969,3980,3986,4043,4145,4187,4197,4210,4250,4303,4330,4340,4403,4413,4574,4663,4694,4700,4735,4805,4810,5136,5141,5298,5304,5436,5442,5722],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"prisma-next-contract-authoring",[46],{"type":47,"value":48},"text","Prisma Next — Contract Authoring",{"type":41,"tag":50,"props":51,"children":52},"blockquote",{},[53],{"type":41,"tag":54,"props":55,"children":56},"p",{},[57],{"type":41,"tag":58,"props":59,"children":60},"strong",{},[61],{"type":47,"value":62},"Edit your data contract. Prisma handles the rest.",{"type":41,"tag":54,"props":64,"children":65},{},[66,68,75,77,83],{"type":47,"value":67},"The data contract is the single source of truth for your data layer. You edit a contract source — ",{"type":41,"tag":69,"props":70,"children":72},"code",{"className":71},[],[73],{"type":47,"value":74},"contract.prisma",{"type":47,"value":76}," (PSL, the canonical surface) or ",{"type":41,"tag":69,"props":78,"children":80},{"className":79},[],[81],{"type":47,"value":82},"contract.ts",{"type":47,"value":84}," (TypeScript builder) — and the framework derives types, migrations, and runtime configuration from it. The three-step user model:",{"type":41,"tag":86,"props":87,"children":88},"ol",{},[89,98,116],{"type":41,"tag":90,"props":91,"children":92},"li",{},[93],{"type":41,"tag":58,"props":94,"children":95},{},[96],{"type":47,"value":97},"You edit your data contract.",{"type":41,"tag":90,"props":99,"children":100},{},[101,106,108,114],{"type":41,"tag":58,"props":102,"children":103},{},[104],{"type":47,"value":105},"The system plans the migrations for you.",{"type":47,"value":107}," (",{"type":41,"tag":69,"props":109,"children":111},{"className":110},[],[112],{"type":47,"value":113},"prisma-next-migrations",{"type":47,"value":115},")",{"type":41,"tag":90,"props":117,"children":118},{},[119,132,133,138],{"type":41,"tag":58,"props":120,"children":121},{},[122,124,130],{"type":47,"value":123},"If you need data migrations, you edit ",{"type":41,"tag":69,"props":125,"children":127},{"className":126},[],[128],{"type":47,"value":129},"migration.ts",{"type":47,"value":131}," and execute it.",{"type":47,"value":107},{"type":41,"tag":69,"props":134,"children":136},{"className":135},[],[137],{"type":47,"value":113},{"type":47,"value":115},{"type":41,"tag":54,"props":140,"children":141},{},[142,144,150,152,158,160,166,168,174],{"type":47,"value":143},"Behind step 1 the agent runs ",{"type":41,"tag":69,"props":145,"children":147},{"className":146},[],[148],{"type":47,"value":149},"prisma-next contract emit",{"type":47,"value":151}," after every contract edit (or installs the Vite plugin so the bundler runs it on save — see ",{"type":41,"tag":69,"props":153,"children":155},{"className":154},[],[156],{"type":47,"value":157},"prisma-next-build",{"type":47,"value":159},"). Emit reads the contract source through the provider the façade picks based on the file extension of ",{"type":41,"tag":69,"props":161,"children":163},{"className":162},[],[164],{"type":47,"value":165},"contract:",{"type":47,"value":167}," in ",{"type":41,"tag":69,"props":169,"children":171},{"className":170},[],[172],{"type":47,"value":173},"prisma-next.config.ts",{"type":47,"value":175},", then writes two artefacts colocated with the source:",{"type":41,"tag":177,"props":178,"children":179},"ul",{},[180,199],{"type":41,"tag":90,"props":181,"children":182},{},[183,189,191,197],{"type":41,"tag":69,"props":184,"children":186},{"className":185},[],[187],{"type":47,"value":188},"contract.json",{"type":47,"value":190}," — the canonical, content-hashed Contract IR. Read by the planner, the runtime, and ",{"type":41,"tag":69,"props":192,"children":194},{"className":193},[],[195],{"type":47,"value":196},"db verify",{"type":47,"value":198},".",{"type":41,"tag":90,"props":200,"children":201},{},[202,208,210,216],{"type":41,"tag":69,"props":203,"children":205},{"className":204},[],[206],{"type":47,"value":207},"contract.d.ts",{"type":47,"value":209}," — the precise TypeScript types the runtime + lanes propagate when you import ",{"type":41,"tag":69,"props":211,"children":213},{"className":212},[],[214],{"type":47,"value":215},"Contract",{"type":47,"value":217}," from it.",{"type":41,"tag":54,"props":219,"children":220},{},[221,223,228,230,236],{"type":47,"value":222},"Both files are ",{"type":41,"tag":58,"props":224,"children":225},{},[226],{"type":47,"value":227},"emitted artefacts",{"type":47,"value":229},". Edit the source; never the JSON or ",{"type":41,"tag":69,"props":231,"children":233},{"className":232},[],[234],{"type":47,"value":235},".d.ts",{"type":47,"value":198},{"type":41,"tag":238,"props":239,"children":241},"h2",{"id":240},"when-to-use",[242],{"type":47,"value":243},"When to Use",{"type":41,"tag":177,"props":245,"children":246},{},[247,252,257,262,282,303,329,334,369],{"type":41,"tag":90,"props":248,"children":249},{},[250],{"type":47,"value":251},"User wants to add, change, or remove a model \u002F field \u002F relation.",{"type":41,"tag":90,"props":253,"children":254},{},[255],{"type":47,"value":256},"User wants to add an index, unique constraint, enum, or value object (composite type).",{"type":41,"tag":90,"props":258,"children":259},{},[260],{"type":47,"value":261},"User wants to add a namespace block (Postgres schema) or a cross-contract foreign key.",{"type":41,"tag":90,"props":263,"children":264},{},[265,267,273,275,281],{"type":47,"value":266},"User wants to set ",{"type":41,"tag":69,"props":268,"children":270},{"className":269},[],[271],{"type":47,"value":272},"@@control",{"type":47,"value":274}," on a model or configure ",{"type":41,"tag":69,"props":276,"children":278},{"className":277},[],[279],{"type":47,"value":280},"defaultControlPolicy",{"type":47,"value":198},{"type":41,"tag":90,"props":283,"children":284},{},[285,287,293,295,301],{"type":47,"value":286},"User wants to use a custom type from an extension (",{"type":41,"tag":69,"props":288,"children":290},{"className":289},[],[291],{"type":47,"value":292},"pgvector.Vector(length: 1536)",{"type":47,"value":294},", ",{"type":41,"tag":69,"props":296,"children":298},{"className":297},[],[299],{"type":47,"value":300},"cipherstash.EncryptedString({...})",{"type":47,"value":302},").",{"type":41,"tag":90,"props":304,"children":305},{},[306,308,314,315,320,322,328],{"type":47,"value":307},"User wants to install or configure an extension via ",{"type":41,"tag":69,"props":309,"children":311},{"className":310},[],[312],{"type":47,"value":313},"extensions: [...]",{"type":47,"value":167},{"type":41,"tag":69,"props":316,"children":318},{"className":317},[],[319],{"type":47,"value":173},{"type":47,"value":321},", including ",{"type":41,"tag":69,"props":323,"children":325},{"className":324},[],[326],{"type":47,"value":327},"@prisma-next\u002Fextension-supabase",{"type":47,"value":198},{"type":41,"tag":90,"props":330,"children":331},{},[332],{"type":47,"value":333},"User is migrating between authoring sources (PSL ↔ TypeScript builder).",{"type":41,"tag":90,"props":335,"children":336},{},[337,339,345,346,352,354,360,362,368],{"type":47,"value":338},"User received ",{"type":41,"tag":69,"props":340,"children":342},{"className":341},[],[343],{"type":47,"value":344},"PN-CLI-4002",{"type":47,"value":294},{"type":41,"tag":69,"props":347,"children":349},{"className":348},[],[350],{"type":47,"value":351},"PN-CLI-4003",{"type":47,"value":353},", or ",{"type":41,"tag":69,"props":355,"children":357},{"className":356},[],[358],{"type":47,"value":359},"PN-CLI-4011",{"type":47,"value":361}," from ",{"type":41,"tag":69,"props":363,"children":365},{"className":364},[],[366],{"type":47,"value":367},"contract emit",{"type":47,"value":198},{"type":41,"tag":90,"props":370,"children":371},{},[372,374,402,404,409],{"type":47,"value":373},"User mentions: ",{"type":41,"tag":375,"props":376,"children":377},"em",{},[378,380,386,387,393,395,400],{"type":47,"value":379},"schema, fields, models, attributes, prisma schema, PSL, contract.prisma, contract.ts, contract.json, contract.d.ts, contract emit, façade imports, ",{"type":41,"tag":69,"props":381,"children":383},{"className":382},[],[384],{"type":47,"value":385},"@prisma-next\u002Fpostgres\u002Fconfig",{"type":47,"value":294},{"type":41,"tag":69,"props":388,"children":390},{"className":389},[],[391],{"type":47,"value":392},"@prisma-next\u002Fpostgres\u002Fcontract-builder",{"type":47,"value":394},", extensions, pgvector, cipherstash, postgis, paradedb, supabase, namespaces, cross-space FK, ",{"type":41,"tag":69,"props":396,"children":398},{"className":397},[],[399],{"type":47,"value":272},{"type":47,"value":401},", enums, value objects, validations, callbacks, soft delete, paranoid, scopes",{"type":47,"value":403},". (The last cluster routes to ",{"type":41,"tag":375,"props":405,"children":406},{},[407],{"type":47,"value":408},"What Prisma Next doesn't do yet",{"type":47,"value":410}," below.)",{"type":41,"tag":238,"props":412,"children":414},{"id":413},"when-not-to-use",[415],{"type":47,"value":416},"When Not to Use",{"type":41,"tag":177,"props":418,"children":419},{},[420,431,443,463,474,486,498],{"type":41,"tag":90,"props":421,"children":422},{},[423,425,430],{"type":47,"value":424},"User wants to apply a contract change to the DB → ",{"type":41,"tag":69,"props":426,"children":428},{"className":427},[],[429],{"type":47,"value":113},{"type":47,"value":198},{"type":41,"tag":90,"props":432,"children":433},{},[434,436,442],{"type":47,"value":435},"User wants to write a query against the contract → ",{"type":41,"tag":69,"props":437,"children":439},{"className":438},[],[440],{"type":47,"value":441},"prisma-next-queries",{"type":47,"value":198},{"type":41,"tag":90,"props":444,"children":445},{},[446,448,454,456,462],{"type":47,"value":447},"User wants to wire ",{"type":41,"tag":69,"props":449,"children":451},{"className":450},[],[452],{"type":47,"value":453},"db.ts",{"type":47,"value":455}," (runtime entry point, middleware, env config) → ",{"type":41,"tag":69,"props":457,"children":459},{"className":458},[],[460],{"type":47,"value":461},"prisma-next-runtime",{"type":47,"value":198},{"type":41,"tag":90,"props":464,"children":465},{},[466,468,473],{"type":47,"value":467},"User wants the Vite \u002F bundler integration → ",{"type":41,"tag":69,"props":469,"children":471},{"className":470},[],[472],{"type":47,"value":157},{"type":47,"value":198},{"type":41,"tag":90,"props":475,"children":476},{},[477,479,485],{"type":47,"value":478},"User wants to set up Prisma Next for the first time → ",{"type":41,"tag":69,"props":480,"children":482},{"className":481},[],[483],{"type":47,"value":484},"prisma-next-quickstart",{"type":47,"value":198},{"type":41,"tag":90,"props":487,"children":488},{},[489,491,497],{"type":47,"value":490},"User wants a deeper read of a single structured error envelope → ",{"type":41,"tag":69,"props":492,"children":494},{"className":493},[],[495],{"type":47,"value":496},"prisma-next-debug",{"type":47,"value":198},{"type":41,"tag":90,"props":499,"children":500},{},[501,503,509],{"type":47,"value":502},"User wants to file a missing-feature request → ",{"type":41,"tag":69,"props":504,"children":506},{"className":505},[],[507],{"type":47,"value":508},"prisma-next-feedback",{"type":47,"value":198},{"type":41,"tag":238,"props":511,"children":513},{"id":512},"key-concepts",[514],{"type":47,"value":515},"Key Concepts",{"type":41,"tag":177,"props":517,"children":518},{},[519,665,769,891,930,1047],{"type":41,"tag":90,"props":520,"children":521},{},[522,535,537,542,543,548,549,555,556,562,564,570,571,577,578,584,586,592,593,599,600,606,608,656,658,663],{"type":41,"tag":58,"props":523,"children":524},{},[525,527,533],{"type":47,"value":526},"The ",{"type":41,"tag":69,"props":528,"children":530},{"className":529},[],[531],{"type":47,"value":532},"@prisma-next\u002F\u003Ctarget>",{"type":47,"value":534}," façade is the only surface user-authored code imports from.",{"type":47,"value":536}," For a Postgres app: ",{"type":41,"tag":69,"props":538,"children":540},{"className":539},[],[541],{"type":47,"value":385},{"type":47,"value":294},{"type":41,"tag":69,"props":544,"children":546},{"className":545},[],[547],{"type":47,"value":392},{"type":47,"value":294},{"type":41,"tag":69,"props":550,"children":552},{"className":551},[],[553],{"type":47,"value":554},"@prisma-next\u002Fpostgres\u002Fcontrol",{"type":47,"value":294},{"type":41,"tag":69,"props":557,"children":559},{"className":558},[],[560],{"type":47,"value":561},"@prisma-next\u002Fpostgres\u002Fruntime",{"type":47,"value":563},". Mongo has the same layout (",{"type":41,"tag":69,"props":565,"children":567},{"className":566},[],[568],{"type":47,"value":569},"@prisma-next\u002Fmongo\u002Fconfig",{"type":47,"value":294},{"type":41,"tag":69,"props":572,"children":574},{"className":573},[],[575],{"type":47,"value":576},"@prisma-next\u002Fmongo\u002Fcontract-builder",{"type":47,"value":294},{"type":41,"tag":69,"props":579,"children":581},{"className":580},[],[582],{"type":47,"value":583},"@prisma-next\u002Fmongo\u002Fruntime",{"type":47,"value":585},"). Each extension publishes its own façade — ",{"type":41,"tag":69,"props":587,"children":589},{"className":588},[],[590],{"type":47,"value":591},"@prisma-next\u002Fextension-pgvector\u002Fcontrol",{"type":47,"value":294},{"type":41,"tag":69,"props":594,"children":596},{"className":595},[],[597],{"type":47,"value":598},"@prisma-next\u002Fextension-postgis\u002Fcontrol",{"type":47,"value":294},{"type":41,"tag":69,"props":601,"children":603},{"className":602},[],[604],{"type":47,"value":605},"@prisma-next\u002Fextension-paradedb\u002Fcontrol",{"type":47,"value":607},". ",{"type":41,"tag":58,"props":609,"children":610},{},[611,613,619,620,626,627,633,634,640,641,647,648,654],{"type":47,"value":612},"Never reach into ",{"type":41,"tag":69,"props":614,"children":616},{"className":615},[],[617],{"type":47,"value":618},"@prisma-next\u002Fcli\u002F*",{"type":47,"value":294},{"type":41,"tag":69,"props":621,"children":623},{"className":622},[],[624],{"type":47,"value":625},"@prisma-next\u002Ffamily-*",{"type":47,"value":294},{"type":41,"tag":69,"props":628,"children":630},{"className":629},[],[631],{"type":47,"value":632},"@prisma-next\u002Ftarget-*",{"type":47,"value":294},{"type":41,"tag":69,"props":635,"children":637},{"className":636},[],[638],{"type":47,"value":639},"@prisma-next\u002Fadapter-*",{"type":47,"value":294},{"type":41,"tag":69,"props":642,"children":644},{"className":643},[],[645],{"type":47,"value":646},"@prisma-next\u002Fdriver-*",{"type":47,"value":353},{"type":41,"tag":69,"props":649,"children":651},{"className":650},[],[652],{"type":47,"value":653},"@prisma-next\u002Fsql-contract-*",{"type":47,"value":655}," from user code.",{"type":47,"value":657}," The façade bakes the family \u002F target \u002F adapter \u002F driver wiring in. See ",{"type":41,"tag":375,"props":659,"children":660},{},[661],{"type":47,"value":662},"Common Pitfalls",{"type":47,"value":664}," #4.",{"type":41,"tag":90,"props":666,"children":667},{},[668,673,675],{"type":41,"tag":58,"props":669,"children":670},{},[671],{"type":47,"value":672},"Contract source.",{"type":47,"value":674}," A file the framework reads and lowers to the canonical Contract IR. Two flavours, both first-class:",{"type":41,"tag":177,"props":676,"children":677},{},[678,717],{"type":41,"tag":90,"props":679,"children":680},{},[681,691,693,699,701,707,709,715],{"type":41,"tag":58,"props":682,"children":683},{},[684,689],{"type":41,"tag":69,"props":685,"children":687},{"className":686},[],[688],{"type":47,"value":74},{"type":47,"value":690}," (PSL)",{"type":47,"value":692}," — schema-flavoured DSL. Canonical for typical apps and brownfield Prisma users. Wired by ",{"type":41,"tag":69,"props":694,"children":696},{"className":695},[],[697],{"type":47,"value":698},"contract: '.\u002F\u003Cpath>\u002Fcontract.prisma'",{"type":47,"value":700}," — the ",{"type":41,"tag":69,"props":702,"children":704},{"className":703},[],[705],{"type":47,"value":706},"defineConfig",{"type":47,"value":708}," façade detects the ",{"type":41,"tag":69,"props":710,"children":712},{"className":711},[],[713],{"type":47,"value":714},".prisma",{"type":47,"value":716}," extension and routes through the PSL provider.",{"type":41,"tag":90,"props":718,"children":719},{},[720,730,732,738,739,744,746,751,753,759,761,767],{"type":41,"tag":58,"props":721,"children":722},{},[723,728],{"type":41,"tag":69,"props":724,"children":726},{"className":725},[],[727],{"type":47,"value":82},{"type":47,"value":729}," (TypeScript builder)",{"type":47,"value":731}," — programmatic authoring with ",{"type":41,"tag":69,"props":733,"children":735},{"className":734},[],[736],{"type":47,"value":737},"defineContract({...}, ({ field, model, rel, type }) => ({...}))",{"type":47,"value":361},{"type":41,"tag":69,"props":740,"children":742},{"className":741},[],[743],{"type":47,"value":392},{"type":47,"value":745}," (or ",{"type":41,"tag":69,"props":747,"children":749},{"className":748},[],[750],{"type":47,"value":576},{"type":47,"value":752},"). Wired by ",{"type":41,"tag":69,"props":754,"children":756},{"className":755},[],[757],{"type":47,"value":758},"contract: '.\u002F\u003Cpath>\u002Fcontract.ts'",{"type":47,"value":760}," — the façade detects the ",{"type":41,"tag":69,"props":762,"children":764},{"className":763},[],[765],{"type":47,"value":766},".ts",{"type":47,"value":768}," extension and routes through the TS provider. Use when you need programmatic composition (per-tenant variants, generated fields) or constructs PSL doesn't yet express (e.g. registering a parameterised extension type — see pgvector's contract).",{"type":41,"tag":90,"props":770,"children":771},{},[772,781,783,789,790,795,796,801,803,809,811,816,818,823,825,831,832,838,839,845,847,853,854,860,862,867,869,874,876,882,884,890],{"type":41,"tag":58,"props":773,"children":774},{},[775,780],{"type":41,"tag":69,"props":776,"children":778},{"className":777},[],[779],{"type":47,"value":173},{"type":47,"value":198},{"type":47,"value":782}," Wires the contract source, the database connection, the migrations directory, and any installed extensions. Use ",{"type":41,"tag":69,"props":784,"children":786},{"className":785},[],[787],{"type":47,"value":788},"defineConfig({...})",{"type":47,"value":361},{"type":41,"tag":69,"props":791,"children":793},{"className":792},[],[794],{"type":47,"value":385},{"type":47,"value":745},{"type":41,"tag":69,"props":797,"children":799},{"className":798},[],[800],{"type":47,"value":569},{"type":47,"value":802},"). The four fields the façade accepts: ",{"type":41,"tag":69,"props":804,"children":806},{"className":805},[],[807],{"type":47,"value":808},"contract",{"type":47,"value":810}," (path string — ",{"type":41,"tag":69,"props":812,"children":814},{"className":813},[],[815],{"type":47,"value":714},{"type":47,"value":817}," or ",{"type":41,"tag":69,"props":819,"children":821},{"className":820},[],[822],{"type":47,"value":766},{"type":47,"value":824},"), ",{"type":41,"tag":69,"props":826,"children":828},{"className":827},[],[829],{"type":47,"value":830},"db",{"type":47,"value":107},{"type":41,"tag":69,"props":833,"children":835},{"className":834},[],[836],{"type":47,"value":837},"{ connection?: string }",{"type":47,"value":824},{"type":41,"tag":69,"props":840,"children":842},{"className":841},[],[843],{"type":47,"value":844},"extensions",{"type":47,"value":846}," (array of control descriptors), ",{"type":41,"tag":69,"props":848,"children":850},{"className":849},[],[851],{"type":47,"value":852},"migrations",{"type":47,"value":107},{"type":41,"tag":69,"props":855,"children":857},{"className":856},[],[858],{"type":47,"value":859},"{ dir?: string }",{"type":47,"value":861},"). The output path for ",{"type":41,"tag":69,"props":863,"children":865},{"className":864},[],[866],{"type":47,"value":188},{"type":47,"value":868}," is auto-derived from ",{"type":41,"tag":69,"props":870,"children":872},{"className":871},[],[873],{"type":47,"value":808},{"type":47,"value":875}," (e.g. ",{"type":41,"tag":69,"props":877,"children":879},{"className":878},[],[880],{"type":47,"value":881},".\u002Fsrc\u002Fprisma\u002Fcontract.prisma",{"type":47,"value":883}," → ",{"type":41,"tag":69,"props":885,"children":887},{"className":886},[],[888],{"type":47,"value":889},".\u002Fsrc\u002Fprisma\u002Fcontract.json",{"type":47,"value":302},{"type":41,"tag":90,"props":892,"children":893},{},[894,899,901,907,909,914,916,921,923,928],{"type":41,"tag":58,"props":895,"children":896},{},[897],{"type":47,"value":898},"Emit pipeline.",{"type":47,"value":900}," ",{"type":41,"tag":69,"props":902,"children":904},{"className":903},[],[905],{"type":47,"value":906},"prisma-next contract emit --config \u003Cpath>?",{"type":47,"value":908}," reads ",{"type":41,"tag":69,"props":910,"children":912},{"className":911},[],[913],{"type":47,"value":173},{"type":47,"value":915},", calls the provider the façade picked, validates the resulting Contract, then atomically writes ",{"type":41,"tag":69,"props":917,"children":919},{"className":918},[],[920],{"type":47,"value":188},{"type":47,"value":922}," + ",{"type":41,"tag":69,"props":924,"children":926},{"className":925},[],[927],{"type":47,"value":207},{"type":47,"value":929}," colocated with the source.",{"type":41,"tag":90,"props":931,"children":932},{},[933,938,940,945,946,952,954,959,961,966,968],{"type":41,"tag":58,"props":934,"children":935},{},[936],{"type":47,"value":937},"Extension namespaces.",{"type":47,"value":939}," Extensions contribute namespaced constructors (",{"type":41,"tag":69,"props":941,"children":943},{"className":942},[],[944],{"type":47,"value":292},{"type":47,"value":294},{"type":41,"tag":69,"props":947,"children":949},{"className":948},[],[950],{"type":47,"value":951},"cipherstash.EncryptedString({equality: true})",{"type":47,"value":953},") and helper presets. Install them by adding the descriptor to ",{"type":41,"tag":58,"props":955,"children":956},{},[957],{"type":47,"value":958},"two",{"type":47,"value":960}," places — both fields are named ",{"type":41,"tag":69,"props":962,"children":964},{"className":963},[],[965],{"type":47,"value":844},{"type":47,"value":967},", but the two surfaces consume two different descriptor types and shapes:",{"type":41,"tag":177,"props":969,"children":970},{},[971,1002],{"type":41,"tag":90,"props":972,"children":973},{},[974,979,980,986,988,993,995,1001],{"type":41,"tag":58,"props":975,"children":976},{},[977],{"type":47,"value":978},"In the config (façade and core):",{"type":47,"value":900},{"type":41,"tag":69,"props":981,"children":983},{"className":982},[],[984],{"type":47,"value":985},"extensions: [pgvector]",{"type":47,"value":987}," — array of ",{"type":41,"tag":375,"props":989,"children":990},{},[991],{"type":47,"value":992},"control",{"type":47,"value":994}," descriptors imported from ",{"type":41,"tag":69,"props":996,"children":998},{"className":997},[],[999],{"type":47,"value":1000},"@prisma-next\u002Fextension-\u003Cname>\u002Fcontrol",{"type":47,"value":198},{"type":41,"tag":90,"props":1003,"children":1004},{},[1005,1025,1026,1032,1034,1039,1040,1046],{"type":41,"tag":58,"props":1006,"children":1007},{},[1008,1010,1016,1018,1023],{"type":47,"value":1009},"In the TS builder's ",{"type":41,"tag":69,"props":1011,"children":1013},{"className":1012},[],[1014],{"type":47,"value":1015},"defineContract",{"type":47,"value":1017}," (only when authoring ",{"type":41,"tag":69,"props":1019,"children":1021},{"className":1020},[],[1022],{"type":47,"value":82},{"type":47,"value":1024},"):",{"type":47,"value":900},{"type":41,"tag":69,"props":1027,"children":1029},{"className":1028},[],[1030],{"type":47,"value":1031},"extensions: { pgvector }",{"type":47,"value":1033}," — record of ",{"type":41,"tag":375,"props":1035,"children":1036},{},[1037],{"type":47,"value":1038},"pack",{"type":47,"value":994},{"type":41,"tag":69,"props":1041,"children":1043},{"className":1042},[],[1044],{"type":47,"value":1045},"@prisma-next\u002Fextension-\u003Cname>\u002Fpack",{"type":47,"value":198},{"type":41,"tag":90,"props":1048,"children":1049},{},[1050,1055,1057,1062,1064,1069,1071,1077,1079,1084,1086,1270,1274,1276,1281,1283,1288],{"type":41,"tag":58,"props":1051,"children":1052},{},[1053],{"type":47,"value":1054},"Contract space.",{"type":47,"value":1056}," Every package that emits a contract owns its own ",{"type":41,"tag":375,"props":1058,"children":1059},{},[1060],{"type":47,"value":1061},"contract space",{"type":47,"value":1063}," — a ",{"type":41,"tag":69,"props":1065,"children":1067},{"className":1066},[],[1068],{"type":47,"value":173},{"type":47,"value":1070}," at package root, a contract source, the colocated emitted artefacts, and a ",{"type":41,"tag":69,"props":1072,"children":1074},{"className":1073},[],[1075],{"type":47,"value":1076},"migrations\u002F",{"type":47,"value":1078}," directory. ",{"type":41,"tag":58,"props":1080,"children":1081},{},[1082],{"type":47,"value":1083},"There are two intentional on-disk layouts",{"type":47,"value":1085},", picked by whether the contract space is the consuming application or a contract-space package (an extension, an internal aggregate-root package, etc.):",{"type":41,"tag":177,"props":1087,"children":1088},{},[1089,1185],{"type":41,"tag":90,"props":1090,"children":1091},{},[1092,1097,1099,1104,1106,1111,1113,1119,1121,1127,1129,1135,1137,1143,1145,1151,1153,1159,1161,1167,1169,1175,1177,1183],{"type":41,"tag":58,"props":1093,"children":1094},{},[1095],{"type":47,"value":1096},"Application layout",{"type":47,"value":1098}," (what you use when building an ",{"type":41,"tag":375,"props":1100,"children":1101},{},[1102],{"type":47,"value":1103},"app",{"type":47,"value":1105},"). ",{"type":41,"tag":69,"props":1107,"children":1109},{"className":1108},[],[1110],{"type":47,"value":173},{"type":47,"value":1112}," at repo root; ",{"type":41,"tag":69,"props":1114,"children":1116},{"className":1115},[],[1117],{"type":47,"value":1118},"src\u002Fprisma\u002Fcontract.{prisma,ts}",{"type":47,"value":1120},"; ",{"type":41,"tag":69,"props":1122,"children":1124},{"className":1123},[],[1125],{"type":47,"value":1126},"src\u002Fprisma\u002Fcontract.{json,d.ts}",{"type":47,"value":1128}," colocated; ",{"type":41,"tag":69,"props":1130,"children":1132},{"className":1131},[],[1133],{"type":47,"value":1134},"src\u002Fprisma\u002Fdb.ts",{"type":47,"value":1136}," colocated; migrations under ",{"type":41,"tag":69,"props":1138,"children":1140},{"className":1139},[],[1141],{"type":47,"value":1142},"migrations\u002Fapp\u002F\u003Ctimestamp>_\u003Cslug>\u002F",{"type":47,"value":1144},". The ",{"type":41,"tag":69,"props":1146,"children":1148},{"className":1147},[],[1149],{"type":47,"value":1150},"app\u002F",{"type":47,"value":1152}," segment is the consuming application's space-id; extension space-ids land in sibling ",{"type":41,"tag":69,"props":1154,"children":1156},{"className":1155},[],[1157],{"type":47,"value":1158},"migrations\u002F\u003Cextension-space-id>\u002F",{"type":47,"value":1160}," directories that the extension packages manage. This is what ",{"type":41,"tag":69,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":47,"value":1166},"examples\u002Fprisma-next-demo",{"type":47,"value":1168}," uses. ",{"type":41,"tag":69,"props":1170,"children":1172},{"className":1171},[],[1173],{"type":47,"value":1174},"prisma-next init",{"type":47,"value":1176}," currently scaffolds something different (",{"type":41,"tag":69,"props":1178,"children":1180},{"className":1179},[],[1181],{"type":47,"value":1182},"prisma\u002F...",{"type":47,"value":1184}," at repo root) — that's a defect (TML-2532); the canonical layout is what every command actually expects to see.",{"type":41,"tag":90,"props":1186,"children":1187},{},[1188,1193,1195,1200,1202,1207,1209,1215,1217,1223,1225,1231,1232,1238,1240,1245,1247,1253,1255,1260,1262,1268],{"type":41,"tag":58,"props":1189,"children":1190},{},[1191],{"type":47,"value":1192},"Contract-space-package layout",{"type":47,"value":1194}," (what you use when ",{"type":41,"tag":375,"props":1196,"children":1197},{},[1198],{"type":47,"value":1199},"publishing",{"type":47,"value":1201}," a contract-space package — extensions, internal monorepo packages). ",{"type":41,"tag":69,"props":1203,"children":1205},{"className":1204},[],[1206],{"type":47,"value":173},{"type":47,"value":1208}," at package root; ",{"type":41,"tag":69,"props":1210,"children":1212},{"className":1211},[],[1213],{"type":47,"value":1214},"src\u002Fcontract.{prisma,ts}",{"type":47,"value":1216}," directly (no ",{"type":41,"tag":69,"props":1218,"children":1220},{"className":1219},[],[1221],{"type":47,"value":1222},"prisma\u002F",{"type":47,"value":1224}," subdir); ",{"type":41,"tag":69,"props":1226,"children":1228},{"className":1227},[],[1229],{"type":47,"value":1230},"src\u002Fcontract.{json,d.ts}",{"type":47,"value":1128},{"type":41,"tag":69,"props":1233,"children":1235},{"className":1234},[],[1236],{"type":47,"value":1237},"migrations\u002F\u003Ctimestamp>_\u003Cslug>\u002F",{"type":47,"value":1239}," directly under ",{"type":41,"tag":69,"props":1241,"children":1243},{"className":1242},[],[1244],{"type":47,"value":1076},{"type":47,"value":1246}," (no ",{"type":41,"tag":69,"props":1248,"children":1250},{"className":1249},[],[1251],{"type":47,"value":1252},"\u003Cspace-id>",{"type":47,"value":1254}," segment — the package ",{"type":41,"tag":375,"props":1256,"children":1257},{},[1258],{"type":47,"value":1259},"is",{"type":47,"value":1261}," a single space). Documented in ",{"type":41,"tag":69,"props":1263,"children":1265},{"className":1264},[],[1266],{"type":47,"value":1267},".cursor\u002Frules\u002Fcontract-space-package-layout.mdc",{"type":47,"value":1269}," and ADR 212.",{"type":41,"tag":1271,"props":1272,"children":1273},"br",{},[],{"type":47,"value":1275},"Both layouts let ",{"type":41,"tag":69,"props":1277,"children":1279},{"className":1278},[],[1280],{"type":47,"value":706},{"type":47,"value":1282},"'s ",{"type":41,"tag":69,"props":1284,"children":1286},{"className":1285},[],[1287],{"type":47,"value":165},{"type":47,"value":1289}," path point at the source; the framework derives everything else (emit output, migration root) from there. Pick the layout that matches what you're building and stick with it — don't mix.",{"type":41,"tag":238,"props":1291,"children":1293},{"id":1292},"diagnostic-codes-you-route-on",[1294],{"type":47,"value":1295},"Diagnostic codes you route on",{"type":41,"tag":54,"props":1297,"children":1298},{},[1299,1304,1306,1311],{"type":41,"tag":69,"props":1300,"children":1302},{"className":1301},[],[1303],{"type":47,"value":149},{"type":47,"value":1305}," surfaces structured errors with stable codes; branch on ",{"type":41,"tag":69,"props":1307,"children":1309},{"className":1308},[],[1310],{"type":47,"value":69},{"type":47,"value":1312}," rather than message text.",{"type":41,"tag":1314,"props":1315,"children":1316},"table",{},[1317,1341],{"type":41,"tag":1318,"props":1319,"children":1320},"thead",{},[1321],{"type":41,"tag":1322,"props":1323,"children":1324},"tr",{},[1325,1331,1336],{"type":41,"tag":1326,"props":1327,"children":1328},"th",{},[1329],{"type":47,"value":1330},"Code",{"type":41,"tag":1326,"props":1332,"children":1333},{},[1334],{"type":47,"value":1335},"Meaning",{"type":41,"tag":1326,"props":1337,"children":1338},{},[1339],{"type":47,"value":1340},"Next move",{"type":41,"tag":1342,"props":1343,"children":1344},"tbody",{},[1345,1419,1462],{"type":41,"tag":1322,"props":1346,"children":1347},{},[1348,1363,1379],{"type":41,"tag":1349,"props":1350,"children":1351},"td",{},[1352,1357,1358],{"type":41,"tag":69,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":47,"value":344},{"type":47,"value":900},{"type":41,"tag":375,"props":1359,"children":1360},{},[1361],{"type":47,"value":1362},"Contract configuration missing",{"type":41,"tag":1349,"props":1364,"children":1365},{},[1366,1371,1373,1378],{"type":41,"tag":69,"props":1367,"children":1369},{"className":1368},[],[1370],{"type":47,"value":808},{"type":47,"value":1372}," not set in ",{"type":41,"tag":69,"props":1374,"children":1376},{"className":1375},[],[1377],{"type":47,"value":173},{"type":47,"value":198},{"type":41,"tag":1349,"props":1380,"children":1381},{},[1382,1384,1390,1392,1398,1400,1405,1407,1412,1413,1418],{"type":47,"value":1383},"Add ",{"type":41,"tag":69,"props":1385,"children":1387},{"className":1386},[],[1388],{"type":47,"value":1389},"contract: '.\u002Fsrc\u002Fprisma\u002Fcontract.prisma'",{"type":47,"value":1391}," (app layout) or ",{"type":41,"tag":69,"props":1393,"children":1395},{"className":1394},[],[1396],{"type":47,"value":1397},"'.\u002Fsrc\u002Fcontract.prisma'",{"type":47,"value":1399}," (contract-space-package layout) — likewise for ",{"type":41,"tag":69,"props":1401,"children":1403},{"className":1402},[],[1404],{"type":47,"value":766},{"type":47,"value":1406}," sources — to ",{"type":41,"tag":69,"props":1408,"children":1410},{"className":1409},[],[1411],{"type":47,"value":788},{"type":47,"value":361},{"type":41,"tag":69,"props":1414,"children":1416},{"className":1415},[],[1417],{"type":47,"value":385},{"type":47,"value":198},{"type":41,"tag":1322,"props":1420,"children":1421},{},[1422,1436,1441],{"type":41,"tag":1349,"props":1423,"children":1424},{},[1425,1430,1431],{"type":41,"tag":69,"props":1426,"children":1428},{"className":1427},[],[1429],{"type":47,"value":351},{"type":47,"value":900},{"type":41,"tag":375,"props":1432,"children":1433},{},[1434],{"type":47,"value":1435},"Contract validation failed",{"type":41,"tag":1349,"props":1437,"children":1438},{},[1439],{"type":47,"value":1440},"Source loaded but the Contract IR failed structural validation.",{"type":41,"tag":1349,"props":1442,"children":1443},{},[1444,1446,1452,1454,1460],{"type":47,"value":1445},"Read ",{"type":41,"tag":69,"props":1447,"children":1449},{"className":1448},[],[1450],{"type":47,"value":1451},"meta.diagnostics",{"type":47,"value":1453}," \u002F ",{"type":41,"tag":69,"props":1455,"children":1457},{"className":1456},[],[1458],{"type":47,"value":1459},"meta.issues",{"type":47,"value":1461}," for the offending model\u002Ffield, fix the source, re-emit.",{"type":41,"tag":1322,"props":1463,"children":1464},{},[1465,1479,1507],{"type":41,"tag":1349,"props":1466,"children":1467},{},[1468,1473,1474],{"type":41,"tag":69,"props":1469,"children":1471},{"className":1470},[],[1472],{"type":47,"value":359},{"type":47,"value":900},{"type":41,"tag":375,"props":1475,"children":1476},{},[1477],{"type":47,"value":1478},"Missing extension packs in config",{"type":41,"tag":1349,"props":1480,"children":1481},{},[1482,1484,1490,1492,1497,1499,1505],{"type":47,"value":1483},"The contract uses a namespaced constructor (e.g. ",{"type":41,"tag":69,"props":1485,"children":1487},{"className":1486},[],[1488],{"type":47,"value":1489},"pgvector.Vector(...)",{"type":47,"value":1491},") but ",{"type":41,"tag":69,"props":1493,"children":1495},{"className":1494},[],[1496],{"type":47,"value":844},{"type":47,"value":1498}," in the config does not list a matching descriptor. ",{"type":41,"tag":69,"props":1500,"children":1502},{"className":1501},[],[1503],{"type":47,"value":1504},"meta.missingExtensions",{"type":47,"value":1506}," names them.",{"type":41,"tag":1349,"props":1508,"children":1509},{},[1510,1512,1518,1520,1525,1526,1531],{"type":47,"value":1511},"Install the package, import its control descriptor (",{"type":41,"tag":69,"props":1513,"children":1515},{"className":1514},[],[1516],{"type":47,"value":1517},"import pgvector from '@prisma-next\u002Fextension-pgvector\u002Fcontrol'",{"type":47,"value":1519},"), add it to ",{"type":41,"tag":69,"props":1521,"children":1523},{"className":1522},[],[1524],{"type":47,"value":313},{"type":47,"value":167},{"type":41,"tag":69,"props":1527,"children":1529},{"className":1528},[],[1530],{"type":47,"value":173},{"type":47,"value":198},{"type":41,"tag":238,"props":1533,"children":1535},{"id":1534},"workflow-read-the-contract-source-of-truth",[1536],{"type":47,"value":1537},"Workflow — Read the contract source of truth",{"type":41,"tag":54,"props":1539,"children":1540},{},[1541,1543,1548,1550,1555,1557,1562],{"type":47,"value":1542},"The concept: every contract change starts by locating the source file. The config is authoritative — read ",{"type":41,"tag":69,"props":1544,"children":1546},{"className":1545},[],[1547],{"type":47,"value":173},{"type":47,"value":1549},", find the ",{"type":41,"tag":69,"props":1551,"children":1553},{"className":1552},[],[1554],{"type":47,"value":165},{"type":47,"value":1556}," field (a path string under the façade), and open the file it points at. The same field tells you the installed ",{"type":41,"tag":69,"props":1558,"children":1560},{"className":1559},[],[1561],{"type":47,"value":313},{"type":47,"value":198},{"type":41,"tag":1564,"props":1565,"children":1570},"pre",{"className":1566,"code":1567,"language":1568,"meta":1569,"style":1569},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","cat prisma-next.config.ts\n","bash","",[1571],{"type":41,"tag":69,"props":1572,"children":1573},{"__ignoreMap":1569},[1574],{"type":41,"tag":1575,"props":1576,"children":1579},"span",{"class":1577,"line":1578},"line",1,[1580,1586],{"type":41,"tag":1575,"props":1581,"children":1583},{"style":1582},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1584],{"type":47,"value":1585},"cat",{"type":41,"tag":1575,"props":1587,"children":1589},{"style":1588},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[1590],{"type":47,"value":1591}," prisma-next.config.ts\n",{"type":41,"tag":54,"props":1593,"children":1594},{},[1595,1597,1602,1604,1609,1611,1616,1618,1623,1625,1630],{"type":47,"value":1596},"If ",{"type":41,"tag":69,"props":1598,"children":1600},{"className":1599},[],[1601],{"type":47,"value":165},{"type":47,"value":1603}," ends in ",{"type":41,"tag":69,"props":1605,"children":1607},{"className":1606},[],[1608],{"type":47,"value":714},{"type":47,"value":1610},", the source is PSL; if it ends in ",{"type":41,"tag":69,"props":1612,"children":1614},{"className":1613},[],[1615],{"type":47,"value":766},{"type":47,"value":1617},", the source is the TS builder. If ",{"type":41,"tag":69,"props":1619,"children":1621},{"className":1620},[],[1622],{"type":47,"value":173},{"type":47,"value":1624}," is missing, route to ",{"type":41,"tag":69,"props":1626,"children":1628},{"className":1627},[],[1629],{"type":47,"value":484},{"type":47,"value":198},{"type":41,"tag":238,"props":1632,"children":1634},{"id":1633},"workflow-edit-a-model-field-relation-psl",[1635],{"type":47,"value":1636},"Workflow — Edit a model \u002F field \u002F relation (PSL)",{"type":41,"tag":54,"props":1638,"children":1639},{},[1640,1642,1648],{"type":47,"value":1641},"The concept: PSL models lower to tables (or collections, on Mongo); fields lower to columns; ",{"type":41,"tag":69,"props":1643,"children":1645},{"className":1644},[],[1646],{"type":47,"value":1647},"@relation(...)",{"type":47,"value":1649}," declares the FK side. Add the relation only on the owning side — the framework derives the back-reference automatically.",{"type":41,"tag":1564,"props":1651,"children":1654},{"className":1652,"code":1653,"language":8,"meta":1569,"style":1569},"language-prisma shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","model User {\n  id    Int    @id @default(autoincrement())\n  email String @unique\n}\n\nmodel Post {\n  id       Int    @id @default(autoincrement())\n  title    String\n  authorId Int\n  author   User   @relation(fields: [authorId], references: [id], onDelete: Cascade)\n\n  @@unique([title, authorId])\n  @@index([authorId])\n}\n",[1655],{"type":41,"tag":69,"props":1656,"children":1657},{"__ignoreMap":1569},[1658,1666,1675,1684,1693,1703,1712,1721,1730,1739,1748,1756,1765,1774],{"type":41,"tag":1575,"props":1659,"children":1660},{"class":1577,"line":1578},[1661],{"type":41,"tag":1575,"props":1662,"children":1663},{},[1664],{"type":47,"value":1665},"model User {\n",{"type":41,"tag":1575,"props":1667,"children":1669},{"class":1577,"line":1668},2,[1670],{"type":41,"tag":1575,"props":1671,"children":1672},{},[1673],{"type":47,"value":1674},"  id    Int    @id @default(autoincrement())\n",{"type":41,"tag":1575,"props":1676,"children":1678},{"class":1577,"line":1677},3,[1679],{"type":41,"tag":1575,"props":1680,"children":1681},{},[1682],{"type":47,"value":1683},"  email String @unique\n",{"type":41,"tag":1575,"props":1685,"children":1687},{"class":1577,"line":1686},4,[1688],{"type":41,"tag":1575,"props":1689,"children":1690},{},[1691],{"type":47,"value":1692},"}\n",{"type":41,"tag":1575,"props":1694,"children":1696},{"class":1577,"line":1695},5,[1697],{"type":41,"tag":1575,"props":1698,"children":1700},{"emptyLinePlaceholder":1699},true,[1701],{"type":47,"value":1702},"\n",{"type":41,"tag":1575,"props":1704,"children":1706},{"class":1577,"line":1705},6,[1707],{"type":41,"tag":1575,"props":1708,"children":1709},{},[1710],{"type":47,"value":1711},"model Post {\n",{"type":41,"tag":1575,"props":1713,"children":1715},{"class":1577,"line":1714},7,[1716],{"type":41,"tag":1575,"props":1717,"children":1718},{},[1719],{"type":47,"value":1720},"  id       Int    @id @default(autoincrement())\n",{"type":41,"tag":1575,"props":1722,"children":1724},{"class":1577,"line":1723},8,[1725],{"type":41,"tag":1575,"props":1726,"children":1727},{},[1728],{"type":47,"value":1729},"  title    String\n",{"type":41,"tag":1575,"props":1731,"children":1733},{"class":1577,"line":1732},9,[1734],{"type":41,"tag":1575,"props":1735,"children":1736},{},[1737],{"type":47,"value":1738},"  authorId Int\n",{"type":41,"tag":1575,"props":1740,"children":1742},{"class":1577,"line":1741},10,[1743],{"type":41,"tag":1575,"props":1744,"children":1745},{},[1746],{"type":47,"value":1747},"  author   User   @relation(fields: [authorId], references: [id], onDelete: Cascade)\n",{"type":41,"tag":1575,"props":1749,"children":1751},{"class":1577,"line":1750},11,[1752],{"type":41,"tag":1575,"props":1753,"children":1754},{"emptyLinePlaceholder":1699},[1755],{"type":47,"value":1702},{"type":41,"tag":1575,"props":1757,"children":1759},{"class":1577,"line":1758},12,[1760],{"type":41,"tag":1575,"props":1761,"children":1762},{},[1763],{"type":47,"value":1764},"  @@unique([title, authorId])\n",{"type":41,"tag":1575,"props":1766,"children":1768},{"class":1577,"line":1767},13,[1769],{"type":41,"tag":1575,"props":1770,"children":1771},{},[1772],{"type":47,"value":1773},"  @@index([authorId])\n",{"type":41,"tag":1575,"props":1775,"children":1777},{"class":1577,"line":1776},14,[1778],{"type":41,"tag":1575,"props":1779,"children":1780},{},[1781],{"type":47,"value":1692},{"type":41,"tag":54,"props":1783,"children":1784},{},[1785,1787,1793,1795,1800,1802,1808,1809,1815,1817,1823],{"type":47,"value":1786},"Then run ",{"type":41,"tag":69,"props":1788,"children":1790},{"className":1789},[],[1791],{"type":47,"value":1792},"pnpm prisma-next contract emit",{"type":47,"value":1794}," (or rely on the Vite plugin — see ",{"type":41,"tag":69,"props":1796,"children":1798},{"className":1797},[],[1799],{"type":47,"value":157},{"type":47,"value":1801},"). Specify cascade behaviour explicitly with ",{"type":41,"tag":69,"props":1803,"children":1805},{"className":1804},[],[1806],{"type":47,"value":1807},"onDelete",{"type":47,"value":1453},{"type":41,"tag":69,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":47,"value":1814},"onUpdate",{"type":47,"value":1816},"; the default is ",{"type":41,"tag":69,"props":1818,"children":1820},{"className":1819},[],[1821],{"type":47,"value":1822},"Restrict",{"type":47,"value":198},{"type":41,"tag":54,"props":1825,"children":1826},{},[1827,1833,1835,1841,1843,1849,1851,1857,1858,1864,1866,1872,1874,1880,1882,1888],{"type":41,"tag":69,"props":1828,"children":1830},{"className":1829},[],[1831],{"type":47,"value":1832},"@@index",{"type":47,"value":1834}," also accepts ",{"type":41,"tag":69,"props":1836,"children":1838},{"className":1837},[],[1839],{"type":47,"value":1840},"expression:",{"type":47,"value":1842}," (instead of a fields list), ",{"type":41,"tag":69,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":47,"value":1848},"where:",{"type":47,"value":1850}," (partial-index predicate), ",{"type":41,"tag":69,"props":1852,"children":1854},{"className":1853},[],[1855],{"type":47,"value":1856},"unique:",{"type":47,"value":294},{"type":41,"tag":69,"props":1859,"children":1861},{"className":1860},[],[1862],{"type":47,"value":1863},"type:",{"type":47,"value":1865},"\u002F",{"type":41,"tag":69,"props":1867,"children":1869},{"className":1868},[],[1870],{"type":47,"value":1871},"options:",{"type":47,"value":1873}," (target-registered access method), and ",{"type":41,"tag":69,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":47,"value":1879},"name:",{"type":47,"value":1881}," xor ",{"type":41,"tag":69,"props":1883,"children":1885},{"className":1884},[],[1886],{"type":47,"value":1887},"map:",{"type":47,"value":1889},":",{"type":41,"tag":1564,"props":1891,"children":1893},{"className":1652,"code":1892,"language":8,"meta":1569,"style":1569},"@@index(expression: \"lower(email)\", name: \"users_email_lower\")\n@@index([authorId], where: \"(archived_at IS NULL)\", name: \"posts_author_active\")\n",[1894],{"type":41,"tag":69,"props":1895,"children":1896},{"__ignoreMap":1569},[1897,1905],{"type":41,"tag":1575,"props":1898,"children":1899},{"class":1577,"line":1578},[1900],{"type":41,"tag":1575,"props":1901,"children":1902},{},[1903],{"type":47,"value":1904},"@@index(expression: \"lower(email)\", name: \"users_email_lower\")\n",{"type":41,"tag":1575,"props":1906,"children":1907},{"class":1577,"line":1668},[1908],{"type":41,"tag":1575,"props":1909,"children":1910},{},[1911],{"type":47,"value":1912},"@@index([authorId], where: \"(archived_at IS NULL)\", name: \"posts_author_active\")\n",{"type":41,"tag":54,"props":1914,"children":1915},{},[1916,1921,1923,1929,1931,1937,1939,1944,1946,1951,1953,1958,1959,1964,1966,1972,1973,1979,1981,1987],{"type":41,"tag":69,"props":1917,"children":1919},{"className":1918},[],[1920],{"type":47,"value":1879},{"type":47,"value":1922}," declares a managed index (physical name ",{"type":41,"tag":69,"props":1924,"children":1926},{"className":1925},[],[1927],{"type":47,"value":1928},"\u003Cname>_\u003C8-hex hash>",{"type":47,"value":1930},", renames plan as ",{"type":41,"tag":69,"props":1932,"children":1934},{"className":1933},[],[1935],{"type":47,"value":1936},"ALTER INDEX … RENAME",{"type":47,"value":1938},"); ",{"type":41,"tag":69,"props":1940,"children":1942},{"className":1941},[],[1943],{"type":47,"value":1887},{"type":47,"value":1945}," adopts an exact physical name verbatim (for infer-captured objects — combining it with a SQL body warns, because drift detection byte-compares the authored text against Postgres's reprint). An ",{"type":41,"tag":69,"props":1947,"children":1949},{"className":1948},[],[1950],{"type":47,"value":1840},{"type":47,"value":1952}," requires ",{"type":41,"tag":69,"props":1954,"children":1956},{"className":1955},[],[1957],{"type":47,"value":1879},{"type":47,"value":817},{"type":41,"tag":69,"props":1960,"children":1962},{"className":1961},[],[1963],{"type":47,"value":1887},{"type":47,"value":1965},". The TS builder mirrors this via ",{"type":41,"tag":69,"props":1967,"children":1969},{"className":1968},[],[1970],{"type":47,"value":1971},"constraints.index([cols.x], {...})",{"type":47,"value":1453},{"type":41,"tag":69,"props":1974,"children":1976},{"className":1975},[],[1977],{"type":47,"value":1978},"constraints.index({ expression, ... })",{"type":47,"value":1980}," — see ",{"type":41,"tag":69,"props":1982,"children":1984},{"className":1983},[],[1985],{"type":47,"value":1986},"packages\u002F2-sql\u002F2-authoring\u002Fcontract-ts\u002FREADME.md",{"type":47,"value":198},{"type":41,"tag":54,"props":1989,"children":1990},{},[1991,1993,1999],{"type":47,"value":1992},"PSL alias surface for repeated types lives in a top-level ",{"type":41,"tag":69,"props":1994,"children":1996},{"className":1995},[],[1997],{"type":47,"value":1998},"types {}",{"type":47,"value":2000}," block:",{"type":41,"tag":1564,"props":2002,"children":2004},{"className":1652,"code":2003,"language":8,"meta":1569,"style":1569},"types {\n  Email = String\n}\n\nmodel User {\n  id    Int    @id @default(autoincrement())\n  email Email  @unique\n}\n",[2005],{"type":41,"tag":69,"props":2006,"children":2007},{"__ignoreMap":1569},[2008,2016,2024,2031,2038,2045,2052,2060],{"type":41,"tag":1575,"props":2009,"children":2010},{"class":1577,"line":1578},[2011],{"type":41,"tag":1575,"props":2012,"children":2013},{},[2014],{"type":47,"value":2015},"types {\n",{"type":41,"tag":1575,"props":2017,"children":2018},{"class":1577,"line":1668},[2019],{"type":41,"tag":1575,"props":2020,"children":2021},{},[2022],{"type":47,"value":2023},"  Email = String\n",{"type":41,"tag":1575,"props":2025,"children":2026},{"class":1577,"line":1677},[2027],{"type":41,"tag":1575,"props":2028,"children":2029},{},[2030],{"type":47,"value":1692},{"type":41,"tag":1575,"props":2032,"children":2033},{"class":1577,"line":1686},[2034],{"type":41,"tag":1575,"props":2035,"children":2036},{"emptyLinePlaceholder":1699},[2037],{"type":47,"value":1702},{"type":41,"tag":1575,"props":2039,"children":2040},{"class":1577,"line":1695},[2041],{"type":41,"tag":1575,"props":2042,"children":2043},{},[2044],{"type":47,"value":1665},{"type":41,"tag":1575,"props":2046,"children":2047},{"class":1577,"line":1705},[2048],{"type":41,"tag":1575,"props":2049,"children":2050},{},[2051],{"type":47,"value":1674},{"type":41,"tag":1575,"props":2053,"children":2054},{"class":1577,"line":1714},[2055],{"type":41,"tag":1575,"props":2056,"children":2057},{},[2058],{"type":47,"value":2059},"  email Email  @unique\n",{"type":41,"tag":1575,"props":2061,"children":2062},{"class":1577,"line":1723},[2063],{"type":41,"tag":1575,"props":2064,"children":2065},{},[2066],{"type":47,"value":1692},{"type":41,"tag":54,"props":2068,"children":2069},{},[2070,2072,2078,2080,2086,2088,2094,2096,2102,2104,2110,2112,2117],{"type":47,"value":2071},"Note: scalar lists (e.g. ",{"type":41,"tag":69,"props":2073,"children":2075},{"className":2074},[],[2076],{"type":47,"value":2077},"String[]",{"type":47,"value":2079},") and implicit Prisma-ORM many-to-many (list nav on both sides without a join model) are rejected by the SQL interpreter — use a join model. Composite\u002Fembeddable types (",{"type":41,"tag":69,"props":2081,"children":2083},{"className":2082},[],[2084],{"type":47,"value":2085},"type Address { ... }",{"type":47,"value":2087}," with ",{"type":41,"tag":69,"props":2089,"children":2091},{"className":2090},[],[2092],{"type":47,"value":2093},"address Address",{"type":47,"value":2095}," on a model) are supported: the interpreter lowers them to ",{"type":41,"tag":69,"props":2097,"children":2099},{"className":2098},[],[2100],{"type":47,"value":2101},"valueObjects",{"type":47,"value":2103}," in the domain and stores them as ",{"type":41,"tag":69,"props":2105,"children":2107},{"className":2106},[],[2108],{"type":47,"value":2109},"jsonb",{"type":47,"value":2111}," columns. See ",{"type":41,"tag":375,"props":2113,"children":2114},{},[2115],{"type":47,"value":2116},"Workflow — Value objects",{"type":47,"value":2118}," below.",{"type":41,"tag":238,"props":2120,"children":2122},{"id":2121},"workflow-edit-a-model-field-relation-ts-builder",[2123],{"type":47,"value":2124},"Workflow — Edit a model \u002F field \u002F relation (TS builder)",{"type":41,"tag":54,"props":2126,"children":2127},{},[2128,2130,2135,2136,2142,2143,2149,2150,2156,2158,2164,2165,2171,2173,2179,2181,2187,2189,2194,2196,2202,2203,2209,2210,2216,2217,2223],{"type":47,"value":2129},"The concept: same model, different authoring surface. The façade re-exports ",{"type":41,"tag":69,"props":2131,"children":2133},{"className":2132},[],[2134],{"type":47,"value":1015},{"type":47,"value":294},{"type":41,"tag":69,"props":2137,"children":2139},{"className":2138},[],[2140],{"type":47,"value":2141},"field",{"type":47,"value":294},{"type":41,"tag":69,"props":2144,"children":2146},{"className":2145},[],[2147],{"type":47,"value":2148},"model",{"type":47,"value":294},{"type":41,"tag":69,"props":2151,"children":2153},{"className":2152},[],[2154],{"type":47,"value":2155},"rel",{"type":47,"value":2157},", plus the ",{"type":41,"tag":69,"props":2159,"children":2161},{"className":2160},[],[2162],{"type":47,"value":2163},"family",{"type":47,"value":1865},{"type":41,"tag":69,"props":2166,"children":2168},{"className":2167},[],[2169],{"type":47,"value":2170},"target",{"type":47,"value":2172}," packs as default exports of ",{"type":41,"tag":69,"props":2174,"children":2176},{"className":2175},[],[2177],{"type":47,"value":2178},"@prisma-next\u002Fpostgres\u002Ffamily",{"type":47,"value":2180}," and ",{"type":41,"tag":69,"props":2182,"children":2184},{"className":2183},[],[2185],{"type":47,"value":2186},"@prisma-next\u002Fpostgres\u002Ftarget",{"type":47,"value":2188},". Use the callback overload (",{"type":41,"tag":69,"props":2190,"children":2192},{"className":2191},[],[2193],{"type":47,"value":737},{"type":47,"value":2195},") to get the higher-level helpers (",{"type":41,"tag":69,"props":2197,"children":2199},{"className":2198},[],[2200],{"type":47,"value":2201},"field.text()",{"type":47,"value":294},{"type":41,"tag":69,"props":2204,"children":2206},{"className":2205},[],[2207],{"type":47,"value":2208},"field.id.uuidv7String()",{"type":47,"value":294},{"type":41,"tag":69,"props":2211,"children":2213},{"className":2212},[],[2214],{"type":47,"value":2215},"field.temporal.createdAt()",{"type":47,"value":294},{"type":41,"tag":69,"props":2218,"children":2220},{"className":2219},[],[2221],{"type":47,"value":2222},"type.sql.String(35)",{"type":47,"value":302},{"type":41,"tag":1564,"props":2225,"children":2228},{"className":2226,"code":2227,"language":14,"meta":1569,"style":1569},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import sqlFamily from '@prisma-next\u002Fpostgres\u002Ffamily';\nimport { defineContract } from '@prisma-next\u002Fpostgres\u002Fcontract-builder';\nimport postgresPack from '@prisma-next\u002Fpostgres\u002Ftarget';\n\nexport const contract = defineContract(\n  {\n    family: sqlFamily,\n    target: postgresPack,\n  },\n  ({ field, model }) => ({\n    models: {\n      User: model('User', {\n        fields: {\n          id: field.id.uuidv7String(),\n          email: field.text().unique(),\n          createdAt: field.temporal.createdAt(),\n        },\n      }).sql({ table: 'app_user' }),\n    },\n  }),\n);\n",[2229],{"type":41,"tag":69,"props":2230,"children":2231},{"__ignoreMap":1569},[2232,2272,2315,2347,2354,2388,2396,2419,2440,2448,2491,2508,2550,2566,2609,2654,2697,2706,2771,2780,2797],{"type":41,"tag":1575,"props":2233,"children":2234},{"class":1577,"line":1578},[2235,2241,2247,2252,2258,2262,2267],{"type":41,"tag":1575,"props":2236,"children":2238},{"style":2237},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[2239],{"type":47,"value":2240},"import",{"type":41,"tag":1575,"props":2242,"children":2244},{"style":2243},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[2245],{"type":47,"value":2246}," sqlFamily ",{"type":41,"tag":1575,"props":2248,"children":2249},{"style":2237},[2250],{"type":47,"value":2251},"from",{"type":41,"tag":1575,"props":2253,"children":2255},{"style":2254},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[2256],{"type":47,"value":2257}," '",{"type":41,"tag":1575,"props":2259,"children":2260},{"style":1588},[2261],{"type":47,"value":2178},{"type":41,"tag":1575,"props":2263,"children":2264},{"style":2254},[2265],{"type":47,"value":2266},"'",{"type":41,"tag":1575,"props":2268,"children":2269},{"style":2254},[2270],{"type":47,"value":2271},";\n",{"type":41,"tag":1575,"props":2273,"children":2274},{"class":1577,"line":1668},[2275,2279,2284,2289,2294,2299,2303,2307,2311],{"type":41,"tag":1575,"props":2276,"children":2277},{"style":2237},[2278],{"type":47,"value":2240},{"type":41,"tag":1575,"props":2280,"children":2281},{"style":2254},[2282],{"type":47,"value":2283}," {",{"type":41,"tag":1575,"props":2285,"children":2286},{"style":2243},[2287],{"type":47,"value":2288}," defineContract",{"type":41,"tag":1575,"props":2290,"children":2291},{"style":2254},[2292],{"type":47,"value":2293}," }",{"type":41,"tag":1575,"props":2295,"children":2296},{"style":2237},[2297],{"type":47,"value":2298}," from",{"type":41,"tag":1575,"props":2300,"children":2301},{"style":2254},[2302],{"type":47,"value":2257},{"type":41,"tag":1575,"props":2304,"children":2305},{"style":1588},[2306],{"type":47,"value":392},{"type":41,"tag":1575,"props":2308,"children":2309},{"style":2254},[2310],{"type":47,"value":2266},{"type":41,"tag":1575,"props":2312,"children":2313},{"style":2254},[2314],{"type":47,"value":2271},{"type":41,"tag":1575,"props":2316,"children":2317},{"class":1577,"line":1677},[2318,2322,2327,2331,2335,2339,2343],{"type":41,"tag":1575,"props":2319,"children":2320},{"style":2237},[2321],{"type":47,"value":2240},{"type":41,"tag":1575,"props":2323,"children":2324},{"style":2243},[2325],{"type":47,"value":2326}," postgresPack ",{"type":41,"tag":1575,"props":2328,"children":2329},{"style":2237},[2330],{"type":47,"value":2251},{"type":41,"tag":1575,"props":2332,"children":2333},{"style":2254},[2334],{"type":47,"value":2257},{"type":41,"tag":1575,"props":2336,"children":2337},{"style":1588},[2338],{"type":47,"value":2186},{"type":41,"tag":1575,"props":2340,"children":2341},{"style":2254},[2342],{"type":47,"value":2266},{"type":41,"tag":1575,"props":2344,"children":2345},{"style":2254},[2346],{"type":47,"value":2271},{"type":41,"tag":1575,"props":2348,"children":2349},{"class":1577,"line":1686},[2350],{"type":41,"tag":1575,"props":2351,"children":2352},{"emptyLinePlaceholder":1699},[2353],{"type":47,"value":1702},{"type":41,"tag":1575,"props":2355,"children":2356},{"class":1577,"line":1695},[2357,2362,2368,2373,2378,2383],{"type":41,"tag":1575,"props":2358,"children":2359},{"style":2237},[2360],{"type":47,"value":2361},"export",{"type":41,"tag":1575,"props":2363,"children":2365},{"style":2364},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[2366],{"type":47,"value":2367}," const",{"type":41,"tag":1575,"props":2369,"children":2370},{"style":2243},[2371],{"type":47,"value":2372}," contract ",{"type":41,"tag":1575,"props":2374,"children":2375},{"style":2254},[2376],{"type":47,"value":2377},"=",{"type":41,"tag":1575,"props":2379,"children":2381},{"style":2380},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[2382],{"type":47,"value":2288},{"type":41,"tag":1575,"props":2384,"children":2385},{"style":2243},[2386],{"type":47,"value":2387},"(\n",{"type":41,"tag":1575,"props":2389,"children":2390},{"class":1577,"line":1705},[2391],{"type":41,"tag":1575,"props":2392,"children":2393},{"style":2254},[2394],{"type":47,"value":2395},"  {\n",{"type":41,"tag":1575,"props":2397,"children":2398},{"class":1577,"line":1714},[2399,2405,2409,2414],{"type":41,"tag":1575,"props":2400,"children":2402},{"style":2401},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[2403],{"type":47,"value":2404},"    family",{"type":41,"tag":1575,"props":2406,"children":2407},{"style":2254},[2408],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2410,"children":2411},{"style":2243},[2412],{"type":47,"value":2413}," sqlFamily",{"type":41,"tag":1575,"props":2415,"children":2416},{"style":2254},[2417],{"type":47,"value":2418},",\n",{"type":41,"tag":1575,"props":2420,"children":2421},{"class":1577,"line":1723},[2422,2427,2431,2436],{"type":41,"tag":1575,"props":2423,"children":2424},{"style":2401},[2425],{"type":47,"value":2426},"    target",{"type":41,"tag":1575,"props":2428,"children":2429},{"style":2254},[2430],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2432,"children":2433},{"style":2243},[2434],{"type":47,"value":2435}," postgresPack",{"type":41,"tag":1575,"props":2437,"children":2438},{"style":2254},[2439],{"type":47,"value":2418},{"type":41,"tag":1575,"props":2441,"children":2442},{"class":1577,"line":1732},[2443],{"type":41,"tag":1575,"props":2444,"children":2445},{"style":2254},[2446],{"type":47,"value":2447},"  },\n",{"type":41,"tag":1575,"props":2449,"children":2450},{"class":1577,"line":1741},[2451,2456,2462,2467,2472,2477,2482,2486],{"type":41,"tag":1575,"props":2452,"children":2453},{"style":2254},[2454],{"type":47,"value":2455},"  ({",{"type":41,"tag":1575,"props":2457,"children":2459},{"style":2458},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2460],{"type":47,"value":2461}," field",{"type":41,"tag":1575,"props":2463,"children":2464},{"style":2254},[2465],{"type":47,"value":2466},",",{"type":41,"tag":1575,"props":2468,"children":2469},{"style":2458},[2470],{"type":47,"value":2471}," model",{"type":41,"tag":1575,"props":2473,"children":2474},{"style":2254},[2475],{"type":47,"value":2476}," })",{"type":41,"tag":1575,"props":2478,"children":2479},{"style":2364},[2480],{"type":47,"value":2481}," =>",{"type":41,"tag":1575,"props":2483,"children":2484},{"style":2243},[2485],{"type":47,"value":107},{"type":41,"tag":1575,"props":2487,"children":2488},{"style":2254},[2489],{"type":47,"value":2490},"{\n",{"type":41,"tag":1575,"props":2492,"children":2493},{"class":1577,"line":1750},[2494,2499,2503],{"type":41,"tag":1575,"props":2495,"children":2496},{"style":2401},[2497],{"type":47,"value":2498},"    models",{"type":41,"tag":1575,"props":2500,"children":2501},{"style":2254},[2502],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2504,"children":2505},{"style":2254},[2506],{"type":47,"value":2507}," {\n",{"type":41,"tag":1575,"props":2509,"children":2510},{"class":1577,"line":1758},[2511,2516,2520,2524,2529,2533,2538,2542,2546],{"type":41,"tag":1575,"props":2512,"children":2513},{"style":2401},[2514],{"type":47,"value":2515},"      User",{"type":41,"tag":1575,"props":2517,"children":2518},{"style":2254},[2519],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2521,"children":2522},{"style":2380},[2523],{"type":47,"value":2471},{"type":41,"tag":1575,"props":2525,"children":2526},{"style":2243},[2527],{"type":47,"value":2528},"(",{"type":41,"tag":1575,"props":2530,"children":2531},{"style":2254},[2532],{"type":47,"value":2266},{"type":41,"tag":1575,"props":2534,"children":2535},{"style":1588},[2536],{"type":47,"value":2537},"User",{"type":41,"tag":1575,"props":2539,"children":2540},{"style":2254},[2541],{"type":47,"value":2266},{"type":41,"tag":1575,"props":2543,"children":2544},{"style":2254},[2545],{"type":47,"value":2466},{"type":41,"tag":1575,"props":2547,"children":2548},{"style":2254},[2549],{"type":47,"value":2507},{"type":41,"tag":1575,"props":2551,"children":2552},{"class":1577,"line":1767},[2553,2558,2562],{"type":41,"tag":1575,"props":2554,"children":2555},{"style":2401},[2556],{"type":47,"value":2557},"        fields",{"type":41,"tag":1575,"props":2559,"children":2560},{"style":2254},[2561],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2563,"children":2564},{"style":2254},[2565],{"type":47,"value":2507},{"type":41,"tag":1575,"props":2567,"children":2568},{"class":1577,"line":1776},[2569,2574,2578,2582,2586,2591,2595,2600,2605],{"type":41,"tag":1575,"props":2570,"children":2571},{"style":2401},[2572],{"type":47,"value":2573},"          id",{"type":41,"tag":1575,"props":2575,"children":2576},{"style":2254},[2577],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2579,"children":2580},{"style":2243},[2581],{"type":47,"value":2461},{"type":41,"tag":1575,"props":2583,"children":2584},{"style":2254},[2585],{"type":47,"value":198},{"type":41,"tag":1575,"props":2587,"children":2588},{"style":2243},[2589],{"type":47,"value":2590},"id",{"type":41,"tag":1575,"props":2592,"children":2593},{"style":2254},[2594],{"type":47,"value":198},{"type":41,"tag":1575,"props":2596,"children":2597},{"style":2380},[2598],{"type":47,"value":2599},"uuidv7String",{"type":41,"tag":1575,"props":2601,"children":2602},{"style":2243},[2603],{"type":47,"value":2604},"()",{"type":41,"tag":1575,"props":2606,"children":2607},{"style":2254},[2608],{"type":47,"value":2418},{"type":41,"tag":1575,"props":2610,"children":2611},{"class":1577,"line":27},[2612,2617,2621,2625,2629,2633,2637,2641,2646,2650],{"type":41,"tag":1575,"props":2613,"children":2614},{"style":2401},[2615],{"type":47,"value":2616},"          email",{"type":41,"tag":1575,"props":2618,"children":2619},{"style":2254},[2620],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2622,"children":2623},{"style":2243},[2624],{"type":47,"value":2461},{"type":41,"tag":1575,"props":2626,"children":2627},{"style":2254},[2628],{"type":47,"value":198},{"type":41,"tag":1575,"props":2630,"children":2631},{"style":2380},[2632],{"type":47,"value":47},{"type":41,"tag":1575,"props":2634,"children":2635},{"style":2243},[2636],{"type":47,"value":2604},{"type":41,"tag":1575,"props":2638,"children":2639},{"style":2254},[2640],{"type":47,"value":198},{"type":41,"tag":1575,"props":2642,"children":2643},{"style":2380},[2644],{"type":47,"value":2645},"unique",{"type":41,"tag":1575,"props":2647,"children":2648},{"style":2243},[2649],{"type":47,"value":2604},{"type":41,"tag":1575,"props":2651,"children":2652},{"style":2254},[2653],{"type":47,"value":2418},{"type":41,"tag":1575,"props":2655,"children":2657},{"class":1577,"line":2656},16,[2658,2663,2667,2671,2675,2680,2684,2689,2693],{"type":41,"tag":1575,"props":2659,"children":2660},{"style":2401},[2661],{"type":47,"value":2662},"          createdAt",{"type":41,"tag":1575,"props":2664,"children":2665},{"style":2254},[2666],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2668,"children":2669},{"style":2243},[2670],{"type":47,"value":2461},{"type":41,"tag":1575,"props":2672,"children":2673},{"style":2254},[2674],{"type":47,"value":198},{"type":41,"tag":1575,"props":2676,"children":2677},{"style":2243},[2678],{"type":47,"value":2679},"temporal",{"type":41,"tag":1575,"props":2681,"children":2682},{"style":2254},[2683],{"type":47,"value":198},{"type":41,"tag":1575,"props":2685,"children":2686},{"style":2380},[2687],{"type":47,"value":2688},"createdAt",{"type":41,"tag":1575,"props":2690,"children":2691},{"style":2243},[2692],{"type":47,"value":2604},{"type":41,"tag":1575,"props":2694,"children":2695},{"style":2254},[2696],{"type":47,"value":2418},{"type":41,"tag":1575,"props":2698,"children":2700},{"class":1577,"line":2699},17,[2701],{"type":41,"tag":1575,"props":2702,"children":2703},{"style":2254},[2704],{"type":47,"value":2705},"        },\n",{"type":41,"tag":1575,"props":2707,"children":2709},{"class":1577,"line":2708},18,[2710,2715,2719,2723,2728,2732,2737,2742,2746,2750,2755,2759,2763,2767],{"type":41,"tag":1575,"props":2711,"children":2712},{"style":2254},[2713],{"type":47,"value":2714},"      }",{"type":41,"tag":1575,"props":2716,"children":2717},{"style":2243},[2718],{"type":47,"value":115},{"type":41,"tag":1575,"props":2720,"children":2721},{"style":2254},[2722],{"type":47,"value":198},{"type":41,"tag":1575,"props":2724,"children":2725},{"style":2380},[2726],{"type":47,"value":2727},"sql",{"type":41,"tag":1575,"props":2729,"children":2730},{"style":2243},[2731],{"type":47,"value":2528},{"type":41,"tag":1575,"props":2733,"children":2734},{"style":2254},[2735],{"type":47,"value":2736},"{",{"type":41,"tag":1575,"props":2738,"children":2739},{"style":2401},[2740],{"type":47,"value":2741}," table",{"type":41,"tag":1575,"props":2743,"children":2744},{"style":2254},[2745],{"type":47,"value":1889},{"type":41,"tag":1575,"props":2747,"children":2748},{"style":2254},[2749],{"type":47,"value":2257},{"type":41,"tag":1575,"props":2751,"children":2752},{"style":1588},[2753],{"type":47,"value":2754},"app_user",{"type":41,"tag":1575,"props":2756,"children":2757},{"style":2254},[2758],{"type":47,"value":2266},{"type":41,"tag":1575,"props":2760,"children":2761},{"style":2254},[2762],{"type":47,"value":2293},{"type":41,"tag":1575,"props":2764,"children":2765},{"style":2243},[2766],{"type":47,"value":115},{"type":41,"tag":1575,"props":2768,"children":2769},{"style":2254},[2770],{"type":47,"value":2418},{"type":41,"tag":1575,"props":2772,"children":2774},{"class":1577,"line":2773},19,[2775],{"type":41,"tag":1575,"props":2776,"children":2777},{"style":2254},[2778],{"type":47,"value":2779},"    },\n",{"type":41,"tag":1575,"props":2781,"children":2783},{"class":1577,"line":2782},20,[2784,2789,2793],{"type":41,"tag":1575,"props":2785,"children":2786},{"style":2254},[2787],{"type":47,"value":2788},"  }",{"type":41,"tag":1575,"props":2790,"children":2791},{"style":2243},[2792],{"type":47,"value":115},{"type":41,"tag":1575,"props":2794,"children":2795},{"style":2254},[2796],{"type":47,"value":2418},{"type":41,"tag":1575,"props":2798,"children":2800},{"class":1577,"line":2799},21,[2801,2805],{"type":41,"tag":1575,"props":2802,"children":2803},{"style":2243},[2804],{"type":47,"value":115},{"type":41,"tag":1575,"props":2806,"children":2807},{"style":2254},[2808],{"type":47,"value":2271},{"type":41,"tag":54,"props":2810,"children":2811},{},[2812,2814,2819,2820,2826,2828,2834,2835,2841,2842,2848],{"type":47,"value":2813},"Then ",{"type":41,"tag":69,"props":2815,"children":2817},{"className":2816},[],[2818],{"type":47,"value":1792},{"type":47,"value":1144},{"type":41,"tag":69,"props":2821,"children":2823},{"className":2822},[],[2824],{"type":47,"value":2825},"field.\u003Cscalar>()",{"type":47,"value":2827}," helpers are only available inside the callback overload; outside the callback only ",{"type":41,"tag":69,"props":2829,"children":2831},{"className":2830},[],[2832],{"type":47,"value":2833},"field.column(...)",{"type":47,"value":294},{"type":41,"tag":69,"props":2836,"children":2838},{"className":2837},[],[2839],{"type":47,"value":2840},"field.generated(...)",{"type":47,"value":294},{"type":41,"tag":69,"props":2843,"children":2845},{"className":2844},[],[2846],{"type":47,"value":2847},"field.namedType(...)",{"type":47,"value":2849}," exist.",{"type":41,"tag":54,"props":2851,"children":2852},{},[2853,2855,2861,2863,2869,2871,2877,2878,2884],{"type":47,"value":2854},"For Mongo, swap every ",{"type":41,"tag":69,"props":2856,"children":2858},{"className":2857},[],[2859],{"type":47,"value":2860},"@prisma-next\u002Fpostgres\u002F*",{"type":47,"value":2862}," import for ",{"type":41,"tag":69,"props":2864,"children":2866},{"className":2865},[],[2867],{"type":47,"value":2868},"@prisma-next\u002Fmongo\u002F*",{"type":47,"value":2870},". The Mongo builder also exposes ",{"type":41,"tag":69,"props":2872,"children":2874},{"className":2873},[],[2875],{"type":47,"value":2876},"index",{"type":47,"value":2180},{"type":41,"tag":69,"props":2879,"children":2881},{"className":2880},[],[2882],{"type":47,"value":2883},"valueObject",{"type":47,"value":198},{"type":41,"tag":238,"props":2886,"children":2888},{"id":2887},"workflow-add-an-extension-typed-scalar-pgvector",[2889],{"type":47,"value":2890},"Workflow — Add an extension-typed scalar (pgvector)",{"type":41,"tag":54,"props":2892,"children":2893},{},[2894,2896,2902,2904,2908,2910,2914,2916,2922,2924,2930],{"type":47,"value":2895},"The concept: an extension contributes a namespace (",{"type":41,"tag":69,"props":2897,"children":2899},{"className":2898},[],[2900],{"type":47,"value":2901},"pgvector.*",{"type":47,"value":2903},") plus two descriptor flavours — a ",{"type":41,"tag":375,"props":2905,"children":2906},{},[2907],{"type":47,"value":992},{"type":47,"value":2909}," descriptor for the config façade and a ",{"type":41,"tag":375,"props":2911,"children":2912},{},[2913],{"type":47,"value":1038},{"type":47,"value":2915}," descriptor for the TS builder. Register the control descriptor in ",{"type":41,"tag":69,"props":2917,"children":2919},{"className":2918},[],[2920],{"type":47,"value":2921},"defineConfig.extensions",{"type":47,"value":2923}," (array form). If you're authoring with the TS builder, also register the pack descriptor in ",{"type":41,"tag":69,"props":2925,"children":2927},{"className":2926},[],[2928],{"type":47,"value":2929},"defineContract.extensions",{"type":47,"value":2931}," (record form). Then reference the namespaced constructor from the contract.",{"type":41,"tag":54,"props":2933,"children":2934},{},[2935,2940],{"type":41,"tag":69,"props":2936,"children":2938},{"className":2937},[],[2939],{"type":47,"value":173},{"type":47,"value":1889},{"type":41,"tag":1564,"props":2942,"children":2944},{"className":2226,"code":2943,"language":14,"meta":1569,"style":1569},"import pgvector from '@prisma-next\u002Fextension-pgvector\u002Fcontrol';\nimport { defineConfig } from '@prisma-next\u002Fpostgres\u002Fconfig';\n\nexport default defineConfig({\n  contract: '.\u002Fsrc\u002Fprisma\u002Fcontract.prisma',\n  extensions: [pgvector],\n});\n",[2945],{"type":41,"tag":69,"props":2946,"children":2947},{"__ignoreMap":1569},[2948,2980,3020,3027,3051,3079,3100],{"type":41,"tag":1575,"props":2949,"children":2950},{"class":1577,"line":1578},[2951,2955,2960,2964,2968,2972,2976],{"type":41,"tag":1575,"props":2952,"children":2953},{"style":2237},[2954],{"type":47,"value":2240},{"type":41,"tag":1575,"props":2956,"children":2957},{"style":2243},[2958],{"type":47,"value":2959}," pgvector ",{"type":41,"tag":1575,"props":2961,"children":2962},{"style":2237},[2963],{"type":47,"value":2251},{"type":41,"tag":1575,"props":2965,"children":2966},{"style":2254},[2967],{"type":47,"value":2257},{"type":41,"tag":1575,"props":2969,"children":2970},{"style":1588},[2971],{"type":47,"value":591},{"type":41,"tag":1575,"props":2973,"children":2974},{"style":2254},[2975],{"type":47,"value":2266},{"type":41,"tag":1575,"props":2977,"children":2978},{"style":2254},[2979],{"type":47,"value":2271},{"type":41,"tag":1575,"props":2981,"children":2982},{"class":1577,"line":1668},[2983,2987,2991,2996,3000,3004,3008,3012,3016],{"type":41,"tag":1575,"props":2984,"children":2985},{"style":2237},[2986],{"type":47,"value":2240},{"type":41,"tag":1575,"props":2988,"children":2989},{"style":2254},[2990],{"type":47,"value":2283},{"type":41,"tag":1575,"props":2992,"children":2993},{"style":2243},[2994],{"type":47,"value":2995}," defineConfig",{"type":41,"tag":1575,"props":2997,"children":2998},{"style":2254},[2999],{"type":47,"value":2293},{"type":41,"tag":1575,"props":3001,"children":3002},{"style":2237},[3003],{"type":47,"value":2298},{"type":41,"tag":1575,"props":3005,"children":3006},{"style":2254},[3007],{"type":47,"value":2257},{"type":41,"tag":1575,"props":3009,"children":3010},{"style":1588},[3011],{"type":47,"value":385},{"type":41,"tag":1575,"props":3013,"children":3014},{"style":2254},[3015],{"type":47,"value":2266},{"type":41,"tag":1575,"props":3017,"children":3018},{"style":2254},[3019],{"type":47,"value":2271},{"type":41,"tag":1575,"props":3021,"children":3022},{"class":1577,"line":1677},[3023],{"type":41,"tag":1575,"props":3024,"children":3025},{"emptyLinePlaceholder":1699},[3026],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3028,"children":3029},{"class":1577,"line":1686},[3030,3034,3039,3043,3047],{"type":41,"tag":1575,"props":3031,"children":3032},{"style":2237},[3033],{"type":47,"value":2361},{"type":41,"tag":1575,"props":3035,"children":3036},{"style":2237},[3037],{"type":47,"value":3038}," default",{"type":41,"tag":1575,"props":3040,"children":3041},{"style":2380},[3042],{"type":47,"value":2995},{"type":41,"tag":1575,"props":3044,"children":3045},{"style":2243},[3046],{"type":47,"value":2528},{"type":41,"tag":1575,"props":3048,"children":3049},{"style":2254},[3050],{"type":47,"value":2490},{"type":41,"tag":1575,"props":3052,"children":3053},{"class":1577,"line":1695},[3054,3059,3063,3067,3071,3075],{"type":41,"tag":1575,"props":3055,"children":3056},{"style":2401},[3057],{"type":47,"value":3058},"  contract",{"type":41,"tag":1575,"props":3060,"children":3061},{"style":2254},[3062],{"type":47,"value":1889},{"type":41,"tag":1575,"props":3064,"children":3065},{"style":2254},[3066],{"type":47,"value":2257},{"type":41,"tag":1575,"props":3068,"children":3069},{"style":1588},[3070],{"type":47,"value":881},{"type":41,"tag":1575,"props":3072,"children":3073},{"style":2254},[3074],{"type":47,"value":2266},{"type":41,"tag":1575,"props":3076,"children":3077},{"style":2254},[3078],{"type":47,"value":2418},{"type":41,"tag":1575,"props":3080,"children":3081},{"class":1577,"line":1705},[3082,3087,3091,3096],{"type":41,"tag":1575,"props":3083,"children":3084},{"style":2401},[3085],{"type":47,"value":3086},"  extensions",{"type":41,"tag":1575,"props":3088,"children":3089},{"style":2254},[3090],{"type":47,"value":1889},{"type":41,"tag":1575,"props":3092,"children":3093},{"style":2243},[3094],{"type":47,"value":3095}," [pgvector]",{"type":41,"tag":1575,"props":3097,"children":3098},{"style":2254},[3099],{"type":47,"value":2418},{"type":41,"tag":1575,"props":3101,"children":3102},{"class":1577,"line":1714},[3103,3108,3112],{"type":41,"tag":1575,"props":3104,"children":3105},{"style":2254},[3106],{"type":47,"value":3107},"}",{"type":41,"tag":1575,"props":3109,"children":3110},{"style":2243},[3111],{"type":47,"value":115},{"type":41,"tag":1575,"props":3113,"children":3114},{"style":2254},[3115],{"type":47,"value":2271},{"type":41,"tag":54,"props":3117,"children":3118},{},[3119,3125],{"type":41,"tag":69,"props":3120,"children":3122},{"className":3121},[],[3123],{"type":47,"value":3124},"src\u002Fprisma\u002Fcontract.prisma",{"type":47,"value":1889},{"type":41,"tag":1564,"props":3127,"children":3129},{"className":1652,"code":3128,"language":8,"meta":1569,"style":1569},"model Document {\n  id        Int                          @id @default(autoincrement())\n  content   String\n  embedding pgvector.Vector(length: 1536)\n}\n",[3130],{"type":41,"tag":69,"props":3131,"children":3132},{"__ignoreMap":1569},[3133,3141,3149,3157,3165],{"type":41,"tag":1575,"props":3134,"children":3135},{"class":1577,"line":1578},[3136],{"type":41,"tag":1575,"props":3137,"children":3138},{},[3139],{"type":47,"value":3140},"model Document {\n",{"type":41,"tag":1575,"props":3142,"children":3143},{"class":1577,"line":1668},[3144],{"type":41,"tag":1575,"props":3145,"children":3146},{},[3147],{"type":47,"value":3148},"  id        Int                          @id @default(autoincrement())\n",{"type":41,"tag":1575,"props":3150,"children":3151},{"class":1577,"line":1677},[3152],{"type":41,"tag":1575,"props":3153,"children":3154},{},[3155],{"type":47,"value":3156},"  content   String\n",{"type":41,"tag":1575,"props":3158,"children":3159},{"class":1577,"line":1686},[3160],{"type":41,"tag":1575,"props":3161,"children":3162},{},[3163],{"type":47,"value":3164},"  embedding pgvector.Vector(length: 1536)\n",{"type":41,"tag":1575,"props":3166,"children":3167},{"class":1577,"line":1695},[3168],{"type":41,"tag":1575,"props":3169,"children":3170},{},[3171],{"type":47,"value":1692},{"type":41,"tag":54,"props":3173,"children":3174},{},[3175,3177,3183,3185,3190],{"type":47,"value":3176},"Emit. The named-type lowering puts ",{"type":41,"tag":69,"props":3178,"children":3180},{"className":3179},[],[3181],{"type":47,"value":3182},"vector(1536)",{"type":47,"value":3184}," on the column and the type map in ",{"type":41,"tag":69,"props":3186,"children":3188},{"className":3187},[],[3189],{"type":47,"value":207},{"type":47,"value":3191}," carries the right TS type.",{"type":41,"tag":54,"props":3193,"children":3194},{},[3195,3197,3202,3204,3209,3210,3216,3218,3224,3226,3238],{"type":47,"value":3196},"If you reference ",{"type":41,"tag":69,"props":3198,"children":3200},{"className":3199},[],[3201],{"type":47,"value":2901},{"type":47,"value":3203}," without registering the pack in the config, emit fails with ",{"type":41,"tag":69,"props":3205,"children":3207},{"className":3206},[],[3208],{"type":47,"value":359},{"type":47,"value":2180},{"type":41,"tag":69,"props":3211,"children":3213},{"className":3212},[],[3214],{"type":47,"value":3215},"meta.missingExtensions: ['pgvector']",{"type":47,"value":3217},". The envelope's ",{"type":41,"tag":69,"props":3219,"children":3221},{"className":3220},[],[3222],{"type":47,"value":3223},"fix",{"type":47,"value":3225}," text says ",{"type":41,"tag":375,"props":3227,"children":3228},{},[3229,3231,3236],{"type":47,"value":3230},"\"Add the missing extension descriptors to ",{"type":41,"tag":69,"props":3232,"children":3234},{"className":3233},[],[3235],{"type":47,"value":844},{"type":47,"value":3237}," in prisma-next.config.ts\"",{"type":47,"value":3239}," — that field name matches the façade.",{"type":41,"tag":54,"props":3241,"children":3242},{},[3243,3245,3251,3252,3258],{"type":47,"value":3244},"For canonical worked examples covering single and multi-extension setups, read ",{"type":41,"tag":69,"props":3246,"children":3248},{"className":3247},[],[3249],{"type":47,"value":3250},"examples\u002Fmulti-extension-monorepo\u002Fapp\u002Fprisma-next.config.ts",{"type":47,"value":2180},{"type":41,"tag":69,"props":3253,"children":3255},{"className":3254},[],[3256],{"type":47,"value":3257},"examples\u002Fprisma-next-postgis-demo\u002Fprisma-next.config.ts",{"type":47,"value":198},{"type":41,"tag":238,"props":3260,"children":3262},{"id":3261},"workflow-polymorphism-discriminator-base",[3263,3265,3271,3272,3278],{"type":47,"value":3264},"Workflow — Polymorphism (",{"type":41,"tag":69,"props":3266,"children":3268},{"className":3267},[],[3269],{"type":47,"value":3270},"@@discriminator",{"type":47,"value":1453},{"type":41,"tag":69,"props":3273,"children":3275},{"className":3274},[],[3276],{"type":47,"value":3277},"@@base",{"type":47,"value":115},{"type":41,"tag":54,"props":3280,"children":3281},{},[3282,3284,3295,3297,3303,3305,3311],{"type":47,"value":3283},"The concept (SQL targets): one base model declares the discriminator field; each variant model declares its base + discriminator value. The variant chooses STI vs MTI by ",{"type":41,"tag":58,"props":3285,"children":3286},{},[3287,3289],{"type":47,"value":3288},"whether it sets ",{"type":41,"tag":69,"props":3290,"children":3292},{"className":3291},[],[3293],{"type":47,"value":3294},"@@map(...)",{"type":47,"value":3296},": no ",{"type":41,"tag":69,"props":3298,"children":3300},{"className":3299},[],[3301],{"type":47,"value":3302},"@@map",{"type":47,"value":3304}," means the variant inherits the base's table (single-table inheritance); ",{"type":41,"tag":69,"props":3306,"children":3308},{"className":3307},[],[3309],{"type":47,"value":3310},"@@map(\"variant_table\")",{"type":47,"value":3312}," means the variant gets its own table joined 1:1 by primary key (multi-table inheritance).",{"type":41,"tag":1564,"props":3314,"children":3316},{"className":1652,"code":3315,"language":8,"meta":1569,"style":1569},"model Task {\n  id    Int    @id @default(autoincrement())\n  title String\n  type  String\n\n  @@discriminator(type)\n  @@map(\"tasks\")\n}\n\n\u002F\u002F STI variant — shares the `tasks` table.\nmodel Bug {\n  severity String\n\n  @@base(Task, \"bug\")\n}\n\n\u002F\u002F MTI variant — joins to `tasks` via PK; carries its own `features` table.\nmodel Feature {\n  priority Int\n\n  @@base(Task, \"feature\")\n  @@map(\"features\")\n}\n",[3317],{"type":41,"tag":69,"props":3318,"children":3319},{"__ignoreMap":1569},[3320,3328,3335,3343,3351,3358,3366,3374,3381,3388,3396,3404,3412,3419,3427,3434,3441,3449,3457,3465,3472,3480,3489],{"type":41,"tag":1575,"props":3321,"children":3322},{"class":1577,"line":1578},[3323],{"type":41,"tag":1575,"props":3324,"children":3325},{},[3326],{"type":47,"value":3327},"model Task {\n",{"type":41,"tag":1575,"props":3329,"children":3330},{"class":1577,"line":1668},[3331],{"type":41,"tag":1575,"props":3332,"children":3333},{},[3334],{"type":47,"value":1674},{"type":41,"tag":1575,"props":3336,"children":3337},{"class":1577,"line":1677},[3338],{"type":41,"tag":1575,"props":3339,"children":3340},{},[3341],{"type":47,"value":3342},"  title String\n",{"type":41,"tag":1575,"props":3344,"children":3345},{"class":1577,"line":1686},[3346],{"type":41,"tag":1575,"props":3347,"children":3348},{},[3349],{"type":47,"value":3350},"  type  String\n",{"type":41,"tag":1575,"props":3352,"children":3353},{"class":1577,"line":1695},[3354],{"type":41,"tag":1575,"props":3355,"children":3356},{"emptyLinePlaceholder":1699},[3357],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3359,"children":3360},{"class":1577,"line":1705},[3361],{"type":41,"tag":1575,"props":3362,"children":3363},{},[3364],{"type":47,"value":3365},"  @@discriminator(type)\n",{"type":41,"tag":1575,"props":3367,"children":3368},{"class":1577,"line":1714},[3369],{"type":41,"tag":1575,"props":3370,"children":3371},{},[3372],{"type":47,"value":3373},"  @@map(\"tasks\")\n",{"type":41,"tag":1575,"props":3375,"children":3376},{"class":1577,"line":1723},[3377],{"type":41,"tag":1575,"props":3378,"children":3379},{},[3380],{"type":47,"value":1692},{"type":41,"tag":1575,"props":3382,"children":3383},{"class":1577,"line":1732},[3384],{"type":41,"tag":1575,"props":3385,"children":3386},{"emptyLinePlaceholder":1699},[3387],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3389,"children":3390},{"class":1577,"line":1741},[3391],{"type":41,"tag":1575,"props":3392,"children":3393},{},[3394],{"type":47,"value":3395},"\u002F\u002F STI variant — shares the `tasks` table.\n",{"type":41,"tag":1575,"props":3397,"children":3398},{"class":1577,"line":1750},[3399],{"type":41,"tag":1575,"props":3400,"children":3401},{},[3402],{"type":47,"value":3403},"model Bug {\n",{"type":41,"tag":1575,"props":3405,"children":3406},{"class":1577,"line":1758},[3407],{"type":41,"tag":1575,"props":3408,"children":3409},{},[3410],{"type":47,"value":3411},"  severity String\n",{"type":41,"tag":1575,"props":3413,"children":3414},{"class":1577,"line":1767},[3415],{"type":41,"tag":1575,"props":3416,"children":3417},{"emptyLinePlaceholder":1699},[3418],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3420,"children":3421},{"class":1577,"line":1776},[3422],{"type":41,"tag":1575,"props":3423,"children":3424},{},[3425],{"type":47,"value":3426},"  @@base(Task, \"bug\")\n",{"type":41,"tag":1575,"props":3428,"children":3429},{"class":1577,"line":27},[3430],{"type":41,"tag":1575,"props":3431,"children":3432},{},[3433],{"type":47,"value":1692},{"type":41,"tag":1575,"props":3435,"children":3436},{"class":1577,"line":2656},[3437],{"type":41,"tag":1575,"props":3438,"children":3439},{"emptyLinePlaceholder":1699},[3440],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3442,"children":3443},{"class":1577,"line":2699},[3444],{"type":41,"tag":1575,"props":3445,"children":3446},{},[3447],{"type":47,"value":3448},"\u002F\u002F MTI variant — joins to `tasks` via PK; carries its own `features` table.\n",{"type":41,"tag":1575,"props":3450,"children":3451},{"class":1577,"line":2708},[3452],{"type":41,"tag":1575,"props":3453,"children":3454},{},[3455],{"type":47,"value":3456},"model Feature {\n",{"type":41,"tag":1575,"props":3458,"children":3459},{"class":1577,"line":2773},[3460],{"type":41,"tag":1575,"props":3461,"children":3462},{},[3463],{"type":47,"value":3464},"  priority Int\n",{"type":41,"tag":1575,"props":3466,"children":3467},{"class":1577,"line":2782},[3468],{"type":41,"tag":1575,"props":3469,"children":3470},{"emptyLinePlaceholder":1699},[3471],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3473,"children":3474},{"class":1577,"line":2799},[3475],{"type":41,"tag":1575,"props":3476,"children":3477},{},[3478],{"type":47,"value":3479},"  @@base(Task, \"feature\")\n",{"type":41,"tag":1575,"props":3481,"children":3483},{"class":1577,"line":3482},22,[3484],{"type":41,"tag":1575,"props":3485,"children":3486},{},[3487],{"type":47,"value":3488},"  @@map(\"features\")\n",{"type":41,"tag":1575,"props":3490,"children":3492},{"class":1577,"line":3491},23,[3493],{"type":41,"tag":1575,"props":3494,"children":3495},{},[3496],{"type":47,"value":1692},{"type":41,"tag":54,"props":3498,"children":3499},{},[3500,3502,3508],{"type":47,"value":3501},"Verify the polymorphism syntax against the interpreter tests if in doubt: ",{"type":41,"tag":69,"props":3503,"children":3505},{"className":3504},[],[3506],{"type":47,"value":3507},"packages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002Ftest\u002Finterpreter.polymorphism.test.ts",{"type":47,"value":198},{"type":41,"tag":54,"props":3510,"children":3511},{},[3512,3514,3520,3522,3527,3528,3533,3534,3539],{"type":47,"value":3513},"Mongo has no schema layer, so polymorphism on Mongo is modelled by an explicit ",{"type":41,"tag":69,"props":3515,"children":3517},{"className":3516},[],[3518],{"type":47,"value":3519},"discriminator",{"type":47,"value":3521}," field on the model in the TS builder (see ",{"type":41,"tag":69,"props":3523,"children":3525},{"className":3524},[],[3526],{"type":47,"value":576},{"type":47,"value":1938},{"type":41,"tag":69,"props":3529,"children":3531},{"className":3530},[],[3532],{"type":47,"value":3277},{"type":47,"value":1453},{"type":41,"tag":69,"props":3535,"children":3537},{"className":3536},[],[3538],{"type":47,"value":3270},{"type":47,"value":3540}," PSL attributes are SQL-only.",{"type":41,"tag":54,"props":3542,"children":3543},{},[3544,3546,3551],{"type":47,"value":3545},"Querying the variants is a runtime concern — see ",{"type":41,"tag":69,"props":3547,"children":3549},{"className":3548},[],[3550],{"type":47,"value":441},{"type":47,"value":198},{"type":41,"tag":238,"props":3553,"children":3555},{"id":3554},"workflow-value-objects-composite-types",[3556],{"type":47,"value":3557},"Workflow — Value objects (composite types)",{"type":41,"tag":54,"props":3559,"children":3560},{},[3561,3563,3569,3571,3576,3578,3583],{"type":47,"value":3562},"The concept: ",{"type":41,"tag":69,"props":3564,"children":3566},{"className":3565},[],[3567],{"type":47,"value":3568},"type Foo { ... }",{"type":47,"value":3570}," blocks declare value-object shapes. The interpreter lowers them to ",{"type":41,"tag":69,"props":3572,"children":3574},{"className":3573},[],[3575],{"type":47,"value":2101},{"type":47,"value":3577}," in the contract domain and stores them as ",{"type":41,"tag":69,"props":3579,"children":3581},{"className":3580},[],[3582],{"type":47,"value":2109},{"type":47,"value":3584}," columns. Nested value-object references are supported.",{"type":41,"tag":1564,"props":3586,"children":3588},{"className":1652,"code":3587,"language":8,"meta":1569,"style":1569},"type Address {\n  street  String\n  city    String\n  zip     String?\n  country String\n}\n\nmodel User {\n  id      String   @id @default(uuid())\n  email   String\n  address Address?\n}\n",[3589],{"type":41,"tag":69,"props":3590,"children":3591},{"__ignoreMap":1569},[3592,3600,3608,3616,3624,3632,3639,3646,3653,3661,3669,3677],{"type":41,"tag":1575,"props":3593,"children":3594},{"class":1577,"line":1578},[3595],{"type":41,"tag":1575,"props":3596,"children":3597},{},[3598],{"type":47,"value":3599},"type Address {\n",{"type":41,"tag":1575,"props":3601,"children":3602},{"class":1577,"line":1668},[3603],{"type":41,"tag":1575,"props":3604,"children":3605},{},[3606],{"type":47,"value":3607},"  street  String\n",{"type":41,"tag":1575,"props":3609,"children":3610},{"class":1577,"line":1677},[3611],{"type":41,"tag":1575,"props":3612,"children":3613},{},[3614],{"type":47,"value":3615},"  city    String\n",{"type":41,"tag":1575,"props":3617,"children":3618},{"class":1577,"line":1686},[3619],{"type":41,"tag":1575,"props":3620,"children":3621},{},[3622],{"type":47,"value":3623},"  zip     String?\n",{"type":41,"tag":1575,"props":3625,"children":3626},{"class":1577,"line":1695},[3627],{"type":41,"tag":1575,"props":3628,"children":3629},{},[3630],{"type":47,"value":3631},"  country String\n",{"type":41,"tag":1575,"props":3633,"children":3634},{"class":1577,"line":1705},[3635],{"type":41,"tag":1575,"props":3636,"children":3637},{},[3638],{"type":47,"value":1692},{"type":41,"tag":1575,"props":3640,"children":3641},{"class":1577,"line":1714},[3642],{"type":41,"tag":1575,"props":3643,"children":3644},{"emptyLinePlaceholder":1699},[3645],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3647,"children":3648},{"class":1577,"line":1723},[3649],{"type":41,"tag":1575,"props":3650,"children":3651},{},[3652],{"type":47,"value":1665},{"type":41,"tag":1575,"props":3654,"children":3655},{"class":1577,"line":1732},[3656],{"type":41,"tag":1575,"props":3657,"children":3658},{},[3659],{"type":47,"value":3660},"  id      String   @id @default(uuid())\n",{"type":41,"tag":1575,"props":3662,"children":3663},{"class":1577,"line":1741},[3664],{"type":41,"tag":1575,"props":3665,"children":3666},{},[3667],{"type":47,"value":3668},"  email   String\n",{"type":41,"tag":1575,"props":3670,"children":3671},{"class":1577,"line":1750},[3672],{"type":41,"tag":1575,"props":3673,"children":3674},{},[3675],{"type":47,"value":3676},"  address Address?\n",{"type":41,"tag":1575,"props":3678,"children":3679},{"class":1577,"line":1758},[3680],{"type":41,"tag":1575,"props":3681,"children":3682},{},[3683],{"type":47,"value":1692},{"type":41,"tag":54,"props":3685,"children":3686},{},[3687,3689,3694,3696,3702,3704,3710,3712,3718,3719,3725,3726,3732],{"type":47,"value":3688},"Emitted ",{"type":41,"tag":69,"props":3690,"children":3692},{"className":3691},[],[3693],{"type":47,"value":188},{"type":47,"value":3695}," carries ",{"type":41,"tag":69,"props":3697,"children":3699},{"className":3698},[],[3700],{"type":47,"value":3701},"domain.namespaces.\u003Cns>.valueObjects.Address",{"type":47,"value":3703}," with its field descriptors, and the ",{"type":41,"tag":69,"props":3705,"children":3707},{"className":3706},[],[3708],{"type":47,"value":3709},"address",{"type":47,"value":3711}," column lands as ",{"type":41,"tag":69,"props":3713,"children":3715},{"className":3714},[],[3716],{"type":47,"value":3717},"codecId: \"pg\u002Fjsonb@1\"",{"type":47,"value":1453},{"type":41,"tag":69,"props":3720,"children":3722},{"className":3721},[],[3723],{"type":47,"value":3724},"nativeType: \"jsonb\"",{"type":47,"value":167},{"type":41,"tag":69,"props":3727,"children":3729},{"className":3728},[],[3730],{"type":47,"value":3731},"storage",{"type":47,"value":198},{"type":41,"tag":54,"props":3734,"children":3735},{},[3736,3738,3744],{"type":47,"value":3737},"Canonical worked example: ",{"type":41,"tag":69,"props":3739,"children":3741},{"className":3740},[],[3742],{"type":47,"value":3743},"examples\u002Fprisma-next-demo\u002Fsrc\u002Fprisma\u002Fcontract.prisma",{"type":47,"value":198},{"type":41,"tag":238,"props":3746,"children":3748},{"id":3747},"workflow-enums",[3749],{"type":47,"value":3750},"Workflow — Enums",{"type":41,"tag":54,"props":3752,"children":3753},{},[3754,3756,3762,3764,3770,3772,3777,3779,3785],{"type":47,"value":3755},"The concept: PSL ",{"type":41,"tag":69,"props":3757,"children":3759},{"className":3758},[],[3760],{"type":47,"value":3761},"enum",{"type":47,"value":3763}," blocks declare a domain enum: a named value-set stored through a declared codec (",{"type":41,"tag":69,"props":3765,"children":3767},{"className":3766},[],[3768],{"type":47,"value":3769},"@@type(\"pg\u002Ftext@1\")",{"type":47,"value":3771}," → a ",{"type":41,"tag":69,"props":3773,"children":3775},{"className":3774},[],[3776],{"type":47,"value":47},{"type":47,"value":3778}," column) and enforced by a planner-generated CHECK constraint. Each member maps to its database value with ",{"type":41,"tag":69,"props":3780,"children":3782},{"className":3781},[],[3783],{"type":47,"value":3784},"Name = \"value\"",{"type":47,"value":3786},". Use the enum name as a field type on any model in the same contract.",{"type":41,"tag":1564,"props":3788,"children":3790},{"className":1652,"code":3789,"language":8,"meta":1569,"style":1569},"enum user_type {\n  @@type(\"pg\u002Ftext@1\")\n  admin = \"admin\"\n  user  = \"user\"\n}\n\nmodel User {\n  id   String    @id @default(uuid())\n  kind user_type\n}\n",[3791],{"type":41,"tag":69,"props":3792,"children":3793},{"__ignoreMap":1569},[3794,3802,3810,3818,3826,3833,3840,3847,3855,3863],{"type":41,"tag":1575,"props":3795,"children":3796},{"class":1577,"line":1578},[3797],{"type":41,"tag":1575,"props":3798,"children":3799},{},[3800],{"type":47,"value":3801},"enum user_type {\n",{"type":41,"tag":1575,"props":3803,"children":3804},{"class":1577,"line":1668},[3805],{"type":41,"tag":1575,"props":3806,"children":3807},{},[3808],{"type":47,"value":3809},"  @@type(\"pg\u002Ftext@1\")\n",{"type":41,"tag":1575,"props":3811,"children":3812},{"class":1577,"line":1677},[3813],{"type":41,"tag":1575,"props":3814,"children":3815},{},[3816],{"type":47,"value":3817},"  admin = \"admin\"\n",{"type":41,"tag":1575,"props":3819,"children":3820},{"class":1577,"line":1686},[3821],{"type":41,"tag":1575,"props":3822,"children":3823},{},[3824],{"type":47,"value":3825},"  user  = \"user\"\n",{"type":41,"tag":1575,"props":3827,"children":3828},{"class":1577,"line":1695},[3829],{"type":41,"tag":1575,"props":3830,"children":3831},{},[3832],{"type":47,"value":1692},{"type":41,"tag":1575,"props":3834,"children":3835},{"class":1577,"line":1705},[3836],{"type":41,"tag":1575,"props":3837,"children":3838},{"emptyLinePlaceholder":1699},[3839],{"type":47,"value":1702},{"type":41,"tag":1575,"props":3841,"children":3842},{"class":1577,"line":1714},[3843],{"type":41,"tag":1575,"props":3844,"children":3845},{},[3846],{"type":47,"value":1665},{"type":41,"tag":1575,"props":3848,"children":3849},{"class":1577,"line":1723},[3850],{"type":41,"tag":1575,"props":3851,"children":3852},{},[3853],{"type":47,"value":3854},"  id   String    @id @default(uuid())\n",{"type":41,"tag":1575,"props":3856,"children":3857},{"class":1577,"line":1732},[3858],{"type":41,"tag":1575,"props":3859,"children":3860},{},[3861],{"type":47,"value":3862},"  kind user_type\n",{"type":41,"tag":1575,"props":3864,"children":3865},{"class":1577,"line":1741},[3866],{"type":41,"tag":1575,"props":3867,"children":3868},{},[3869],{"type":47,"value":1692},{"type":41,"tag":54,"props":3871,"children":3872},{},[3873,3874,3879],{"type":47,"value":3737},{"type":41,"tag":69,"props":3875,"children":3877},{"className":3876},[],[3878],{"type":47,"value":3743},{"type":47,"value":198},{"type":41,"tag":238,"props":3881,"children":3883},{"id":3882},"workflow-namespaces-postgres-schemas",[3884],{"type":47,"value":3885},"Workflow — Namespaces (Postgres schemas)",{"type":41,"tag":54,"props":3887,"children":3888},{},[3889,3891,3897],{"type":47,"value":3890},"The concept: wrap models in a ",{"type":41,"tag":69,"props":3892,"children":3894},{"className":3893},[],[3895],{"type":47,"value":3896},"namespace \u003Cname> { ... }",{"type":47,"value":3898}," block to place them in a non-default Postgres schema. Models outside any block go into the implicit default namespace.",{"type":41,"tag":1564,"props":3900,"children":3902},{"className":1652,"code":3901,"language":8,"meta":1569,"style":1569},"namespace public {\n  model Profile {\n    id       String @id @default(uuid())\n    username String\n    userId   String @unique\n    @@map(\"profile\")\n  }\n}\n",[3903],{"type":41,"tag":69,"props":3904,"children":3905},{"__ignoreMap":1569},[3906,3914,3922,3930,3938,3946,3954,3962],{"type":41,"tag":1575,"props":3907,"children":3908},{"class":1577,"line":1578},[3909],{"type":41,"tag":1575,"props":3910,"children":3911},{},[3912],{"type":47,"value":3913},"namespace public {\n",{"type":41,"tag":1575,"props":3915,"children":3916},{"class":1577,"line":1668},[3917],{"type":41,"tag":1575,"props":3918,"children":3919},{},[3920],{"type":47,"value":3921},"  model Profile {\n",{"type":41,"tag":1575,"props":3923,"children":3924},{"class":1577,"line":1677},[3925],{"type":41,"tag":1575,"props":3926,"children":3927},{},[3928],{"type":47,"value":3929},"    id       String @id @default(uuid())\n",{"type":41,"tag":1575,"props":3931,"children":3932},{"class":1577,"line":1686},[3933],{"type":41,"tag":1575,"props":3934,"children":3935},{},[3936],{"type":47,"value":3937},"    username String\n",{"type":41,"tag":1575,"props":3939,"children":3940},{"class":1577,"line":1695},[3941],{"type":41,"tag":1575,"props":3942,"children":3943},{},[3944],{"type":47,"value":3945},"    userId   String @unique\n",{"type":41,"tag":1575,"props":3947,"children":3948},{"class":1577,"line":1705},[3949],{"type":41,"tag":1575,"props":3950,"children":3951},{},[3952],{"type":47,"value":3953},"    @@map(\"profile\")\n",{"type":41,"tag":1575,"props":3955,"children":3956},{"class":1577,"line":1714},[3957],{"type":41,"tag":1575,"props":3958,"children":3959},{},[3960],{"type":47,"value":3961},"  }\n",{"type":41,"tag":1575,"props":3963,"children":3964},{"class":1577,"line":1723},[3965],{"type":41,"tag":1575,"props":3966,"children":3967},{},[3968],{"type":47,"value":1692},{"type":41,"tag":54,"props":3970,"children":3971},{},[3972,3973,3979],{"type":47,"value":3737},{"type":41,"tag":69,"props":3974,"children":3976},{"className":3975},[],[3977],{"type":47,"value":3978},"examples\u002Fsupabase\u002Fsrc\u002Fcontract.prisma",{"type":47,"value":198},{"type":41,"tag":238,"props":3981,"children":3983},{"id":3982},"workflow-cross-contract-foreign-keys",[3984],{"type":47,"value":3985},"Workflow — Cross-contract foreign keys",{"type":41,"tag":54,"props":3987,"children":3988},{},[3989,3991,3997,3999,4004,4006,4012,4014,4020,4022,4028,4029,4034,4035,4041],{"type":47,"value":3990},"The concept: a relation field can reference a model in another contract space using the ",{"type":41,"tag":69,"props":3992,"children":3994},{"className":3993},[],[3995],{"type":47,"value":3996},"\u003Cspace>:\u003Cnamespace>.\u003CModel>",{"type":47,"value":3998}," form. The contract also supports top-level named-type aliases in a ",{"type":41,"tag":69,"props":4000,"children":4002},{"className":4001},[],[4003],{"type":47,"value":1998},{"type":47,"value":4005}," block, backed by the same bare type-position constructors used by fields. The ",{"type":41,"tag":69,"props":4007,"children":4009},{"className":4008},[],[4010],{"type":47,"value":4011},"@db.X(args)",{"type":47,"value":4013}," channel is removed: rewrite ",{"type":41,"tag":69,"props":4015,"children":4017},{"className":4016},[],[4018],{"type":47,"value":4019},"@db.X",{"type":47,"value":4021}," as ",{"type":41,"tag":69,"props":4023,"children":4025},{"className":4024},[],[4026],{"type":47,"value":4027},"X",{"type":47,"value":2180},{"type":41,"tag":69,"props":4030,"children":4032},{"className":4031},[],[4033],{"type":47,"value":4011},{"type":47,"value":4021},{"type":41,"tag":69,"props":4036,"children":4038},{"className":4037},[],[4039],{"type":47,"value":4040},"X(args)",{"type":47,"value":4042},"; remaining uses fail with an actionable diagnostic naming the replacement.",{"type":41,"tag":1564,"props":4044,"children":4046},{"className":1652,"code":4045,"language":8,"meta":1569,"style":1569},"types {\n  AuthUserId = Uuid\n}\n\nnamespace public {\n  model Profile {\n    id       String     @id @default(uuid())\n    username String\n    userId   AuthUserId @unique\n    user     supabase:auth.AuthUser @relation(fields: [userId], references: [id], onDelete: Cascade)\n    @@map(\"profile\")\n  }\n}\n",[4047],{"type":41,"tag":69,"props":4048,"children":4049},{"__ignoreMap":1569},[4050,4057,4065,4072,4079,4086,4093,4101,4108,4116,4124,4131,4138],{"type":41,"tag":1575,"props":4051,"children":4052},{"class":1577,"line":1578},[4053],{"type":41,"tag":1575,"props":4054,"children":4055},{},[4056],{"type":47,"value":2015},{"type":41,"tag":1575,"props":4058,"children":4059},{"class":1577,"line":1668},[4060],{"type":41,"tag":1575,"props":4061,"children":4062},{},[4063],{"type":47,"value":4064},"  AuthUserId = Uuid\n",{"type":41,"tag":1575,"props":4066,"children":4067},{"class":1577,"line":1677},[4068],{"type":41,"tag":1575,"props":4069,"children":4070},{},[4071],{"type":47,"value":1692},{"type":41,"tag":1575,"props":4073,"children":4074},{"class":1577,"line":1686},[4075],{"type":41,"tag":1575,"props":4076,"children":4077},{"emptyLinePlaceholder":1699},[4078],{"type":47,"value":1702},{"type":41,"tag":1575,"props":4080,"children":4081},{"class":1577,"line":1695},[4082],{"type":41,"tag":1575,"props":4083,"children":4084},{},[4085],{"type":47,"value":3913},{"type":41,"tag":1575,"props":4087,"children":4088},{"class":1577,"line":1705},[4089],{"type":41,"tag":1575,"props":4090,"children":4091},{},[4092],{"type":47,"value":3921},{"type":41,"tag":1575,"props":4094,"children":4095},{"class":1577,"line":1714},[4096],{"type":41,"tag":1575,"props":4097,"children":4098},{},[4099],{"type":47,"value":4100},"    id       String     @id @default(uuid())\n",{"type":41,"tag":1575,"props":4102,"children":4103},{"class":1577,"line":1723},[4104],{"type":41,"tag":1575,"props":4105,"children":4106},{},[4107],{"type":47,"value":3937},{"type":41,"tag":1575,"props":4109,"children":4110},{"class":1577,"line":1732},[4111],{"type":41,"tag":1575,"props":4112,"children":4113},{},[4114],{"type":47,"value":4115},"    userId   AuthUserId @unique\n",{"type":41,"tag":1575,"props":4117,"children":4118},{"class":1577,"line":1741},[4119],{"type":41,"tag":1575,"props":4120,"children":4121},{},[4122],{"type":47,"value":4123},"    user     supabase:auth.AuthUser @relation(fields: [userId], references: [id], onDelete: Cascade)\n",{"type":41,"tag":1575,"props":4125,"children":4126},{"class":1577,"line":1750},[4127],{"type":41,"tag":1575,"props":4128,"children":4129},{},[4130],{"type":47,"value":3953},{"type":41,"tag":1575,"props":4132,"children":4133},{"class":1577,"line":1758},[4134],{"type":41,"tag":1575,"props":4135,"children":4136},{},[4137],{"type":47,"value":3961},{"type":41,"tag":1575,"props":4139,"children":4140},{"class":1577,"line":1767},[4141],{"type":41,"tag":1575,"props":4142,"children":4143},{},[4144],{"type":47,"value":1692},{"type":41,"tag":54,"props":4146,"children":4147},{},[4148,4154,4156,4162,4164,4170,4172,4178,4180,4186],{"type":41,"tag":69,"props":4149,"children":4151},{"className":4150},[],[4152],{"type":47,"value":4153},"supabase:auth.AuthUser",{"type":47,"value":4155}," means: model ",{"type":41,"tag":69,"props":4157,"children":4159},{"className":4158},[],[4160],{"type":47,"value":4161},"AuthUser",{"type":47,"value":4163}," in namespace ",{"type":41,"tag":69,"props":4165,"children":4167},{"className":4166},[],[4168],{"type":47,"value":4169},"auth",{"type":47,"value":4171}," of contract space ",{"type":41,"tag":69,"props":4173,"children":4175},{"className":4174},[],[4176],{"type":47,"value":4177},"supabase",{"type":47,"value":4179},". The target space is provided by a registered extension pack (here ",{"type":41,"tag":69,"props":4181,"children":4183},{"className":4182},[],[4184],{"type":47,"value":4185},"@prisma-next\u002Fextension-supabase\u002Fpack",{"type":47,"value":302},{"type":41,"tag":54,"props":4188,"children":4189},{},[4190,4191,4196],{"type":47,"value":3737},{"type":41,"tag":69,"props":4192,"children":4194},{"className":4193},[],[4195],{"type":47,"value":3978},{"type":47,"value":198},{"type":41,"tag":238,"props":4198,"children":4200},{"id":4199},"workflow-control-control-policy",[4201,4203,4208],{"type":47,"value":4202},"Workflow — ",{"type":41,"tag":69,"props":4204,"children":4206},{"className":4205},[],[4207],{"type":47,"value":272},{"type":47,"value":4209}," (control policy)",{"type":41,"tag":54,"props":4211,"children":4212},{},[4213,4214,4220,4222,4228,4229,4235,4236,4242,4243,4249],{"type":47,"value":3562},{"type":41,"tag":69,"props":4215,"children":4217},{"className":4216},[],[4218],{"type":47,"value":4219},"@@control(\u003Cpolicy>)",{"type":47,"value":4221}," on a model sets whether Prisma manages that table's DDL in migrations. The argument is a positional lowercase literal — one of ",{"type":41,"tag":69,"props":4223,"children":4225},{"className":4224},[],[4226],{"type":47,"value":4227},"managed",{"type":47,"value":294},{"type":41,"tag":69,"props":4230,"children":4232},{"className":4231},[],[4233],{"type":47,"value":4234},"tolerated",{"type":47,"value":294},{"type":41,"tag":69,"props":4237,"children":4239},{"className":4238},[],[4240],{"type":47,"value":4241},"external",{"type":47,"value":353},{"type":41,"tag":69,"props":4244,"children":4246},{"className":4245},[],[4247],{"type":47,"value":4248},"observed",{"type":47,"value":198},{"type":41,"tag":1564,"props":4251,"children":4253},{"className":1652,"code":4252,"language":8,"meta":1569,"style":1569},"model AuditLog {\n  id        Int    @id\n  message   String\n\n  @@control(observed)\n}\n",[4254],{"type":41,"tag":69,"props":4255,"children":4256},{"__ignoreMap":1569},[4257,4265,4273,4281,4288,4296],{"type":41,"tag":1575,"props":4258,"children":4259},{"class":1577,"line":1578},[4260],{"type":41,"tag":1575,"props":4261,"children":4262},{},[4263],{"type":47,"value":4264},"model AuditLog {\n",{"type":41,"tag":1575,"props":4266,"children":4267},{"class":1577,"line":1668},[4268],{"type":41,"tag":1575,"props":4269,"children":4270},{},[4271],{"type":47,"value":4272},"  id        Int    @id\n",{"type":41,"tag":1575,"props":4274,"children":4275},{"class":1577,"line":1677},[4276],{"type":41,"tag":1575,"props":4277,"children":4278},{},[4279],{"type":47,"value":4280},"  message   String\n",{"type":41,"tag":1575,"props":4282,"children":4283},{"class":1577,"line":1686},[4284],{"type":41,"tag":1575,"props":4285,"children":4286},{"emptyLinePlaceholder":1699},[4287],{"type":47,"value":1702},{"type":41,"tag":1575,"props":4289,"children":4290},{"class":1577,"line":1695},[4291],{"type":41,"tag":1575,"props":4292,"children":4293},{},[4294],{"type":47,"value":4295},"  @@control(observed)\n",{"type":41,"tag":1575,"props":4297,"children":4298},{"class":1577,"line":1705},[4299],{"type":41,"tag":1575,"props":4300,"children":4301},{},[4302],{"type":47,"value":1692},{"type":41,"tag":54,"props":4304,"children":4305},{},[4306,4308,4313,4315,4321,4323,4328],{"type":47,"value":4307},"A contract-level default can be set via ",{"type":41,"tag":69,"props":4309,"children":4311},{"className":4310},[],[4312],{"type":47,"value":280},{"type":47,"value":4314}," on ",{"type":41,"tag":69,"props":4316,"children":4318},{"className":4317},[],[4319],{"type":47,"value":4320},"prismaContract(path, { defaultControlPolicy })",{"type":47,"value":4322},". See ",{"type":41,"tag":69,"props":4324,"children":4326},{"className":4325},[],[4327],{"type":47,"value":113},{"type":47,"value":4329}," for how control policies affect DDL planning.",{"type":41,"tag":238,"props":4331,"children":4333},{"id":4332},"workflow-prisma-nextextension-supabase",[4334,4335],{"type":47,"value":4202},{"type":41,"tag":69,"props":4336,"children":4338},{"className":4337},[],[4339],{"type":47,"value":327},{"type":41,"tag":54,"props":4341,"children":4342},{},[4343,4345,4350,4352,4357,4358,4363,4365,4370,4372,4378,4380,4386,4388,4393,4395,4401],{"type":47,"value":4344},"The concept: the Supabase extension provides the ",{"type":41,"tag":69,"props":4346,"children":4348},{"className":4347},[],[4349],{"type":47,"value":4177},{"type":47,"value":4351}," contract space (the ",{"type":41,"tag":69,"props":4353,"children":4355},{"className":4354},[],[4356],{"type":47,"value":4169},{"type":47,"value":1453},{"type":41,"tag":69,"props":4359,"children":4361},{"className":4360},[],[4362],{"type":47,"value":3731},{"type":47,"value":4364}," schemas as ",{"type":41,"tag":69,"props":4366,"children":4368},{"className":4367},[],[4369],{"type":47,"value":4241},{"type":47,"value":4371}," tables, plus the platform roles) and its own role-first runtime factory. It does not expose a ",{"type":41,"tag":69,"props":4373,"children":4375},{"className":4374},[],[4376],{"type":47,"value":4377},"\u002Fcontrol",{"type":47,"value":4379}," subpath so it cannot be registered via the user-facing ",{"type":41,"tag":69,"props":4381,"children":4383},{"className":4382},[],[4384],{"type":47,"value":4385},"defineConfig({ extensions: [...] })",{"type":47,"value":4387}," façade — it is wired via ",{"type":41,"tag":69,"props":4389,"children":4391},{"className":4390},[],[4392],{"type":47,"value":844},{"type":47,"value":4394}," in the low-level config. See ",{"type":41,"tag":69,"props":4396,"children":4398},{"className":4397},[],[4399],{"type":47,"value":4400},"examples\u002Fsupabase",{"type":47,"value":4402}," for the full working pattern.",{"type":41,"tag":54,"props":4404,"children":4405},{},[4406,4411],{"type":41,"tag":69,"props":4407,"children":4409},{"className":4408},[],[4410],{"type":47,"value":173},{"type":47,"value":4412}," (mirrors the example):",{"type":41,"tag":1564,"props":4414,"children":4416},{"className":2226,"code":4415,"language":14,"meta":1569,"style":1569},"import supabasePack from '@prisma-next\u002Fextension-supabase\u002Fpack';\nimport { defineConfig } from '@prisma-next\u002Fcli\u002Fconfig-types';\n\u002F\u002F ... other low-level imports\n\nexport default defineConfig({\n  \u002F\u002F ...\n  extensions: [supabasePack],\n});\n",[4417],{"type":41,"tag":69,"props":4418,"children":4419},{"__ignoreMap":1569},[4420,4452,4492,4501,4508,4531,4539,4559],{"type":41,"tag":1575,"props":4421,"children":4422},{"class":1577,"line":1578},[4423,4427,4432,4436,4440,4444,4448],{"type":41,"tag":1575,"props":4424,"children":4425},{"style":2237},[4426],{"type":47,"value":2240},{"type":41,"tag":1575,"props":4428,"children":4429},{"style":2243},[4430],{"type":47,"value":4431}," supabasePack ",{"type":41,"tag":1575,"props":4433,"children":4434},{"style":2237},[4435],{"type":47,"value":2251},{"type":41,"tag":1575,"props":4437,"children":4438},{"style":2254},[4439],{"type":47,"value":2257},{"type":41,"tag":1575,"props":4441,"children":4442},{"style":1588},[4443],{"type":47,"value":4185},{"type":41,"tag":1575,"props":4445,"children":4446},{"style":2254},[4447],{"type":47,"value":2266},{"type":41,"tag":1575,"props":4449,"children":4450},{"style":2254},[4451],{"type":47,"value":2271},{"type":41,"tag":1575,"props":4453,"children":4454},{"class":1577,"line":1668},[4455,4459,4463,4467,4471,4475,4479,4484,4488],{"type":41,"tag":1575,"props":4456,"children":4457},{"style":2237},[4458],{"type":47,"value":2240},{"type":41,"tag":1575,"props":4460,"children":4461},{"style":2254},[4462],{"type":47,"value":2283},{"type":41,"tag":1575,"props":4464,"children":4465},{"style":2243},[4466],{"type":47,"value":2995},{"type":41,"tag":1575,"props":4468,"children":4469},{"style":2254},[4470],{"type":47,"value":2293},{"type":41,"tag":1575,"props":4472,"children":4473},{"style":2237},[4474],{"type":47,"value":2298},{"type":41,"tag":1575,"props":4476,"children":4477},{"style":2254},[4478],{"type":47,"value":2257},{"type":41,"tag":1575,"props":4480,"children":4481},{"style":1588},[4482],{"type":47,"value":4483},"@prisma-next\u002Fcli\u002Fconfig-types",{"type":41,"tag":1575,"props":4485,"children":4486},{"style":2254},[4487],{"type":47,"value":2266},{"type":41,"tag":1575,"props":4489,"children":4490},{"style":2254},[4491],{"type":47,"value":2271},{"type":41,"tag":1575,"props":4493,"children":4494},{"class":1577,"line":1677},[4495],{"type":41,"tag":1575,"props":4496,"children":4498},{"style":4497},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[4499],{"type":47,"value":4500},"\u002F\u002F ... other low-level imports\n",{"type":41,"tag":1575,"props":4502,"children":4503},{"class":1577,"line":1686},[4504],{"type":41,"tag":1575,"props":4505,"children":4506},{"emptyLinePlaceholder":1699},[4507],{"type":47,"value":1702},{"type":41,"tag":1575,"props":4509,"children":4510},{"class":1577,"line":1695},[4511,4515,4519,4523,4527],{"type":41,"tag":1575,"props":4512,"children":4513},{"style":2237},[4514],{"type":47,"value":2361},{"type":41,"tag":1575,"props":4516,"children":4517},{"style":2237},[4518],{"type":47,"value":3038},{"type":41,"tag":1575,"props":4520,"children":4521},{"style":2380},[4522],{"type":47,"value":2995},{"type":41,"tag":1575,"props":4524,"children":4525},{"style":2243},[4526],{"type":47,"value":2528},{"type":41,"tag":1575,"props":4528,"children":4529},{"style":2254},[4530],{"type":47,"value":2490},{"type":41,"tag":1575,"props":4532,"children":4533},{"class":1577,"line":1705},[4534],{"type":41,"tag":1575,"props":4535,"children":4536},{"style":4497},[4537],{"type":47,"value":4538},"  \u002F\u002F ...\n",{"type":41,"tag":1575,"props":4540,"children":4541},{"class":1577,"line":1714},[4542,4546,4550,4555],{"type":41,"tag":1575,"props":4543,"children":4544},{"style":2401},[4545],{"type":47,"value":3086},{"type":41,"tag":1575,"props":4547,"children":4548},{"style":2254},[4549],{"type":47,"value":1889},{"type":41,"tag":1575,"props":4551,"children":4552},{"style":2243},[4553],{"type":47,"value":4554}," [supabasePack]",{"type":41,"tag":1575,"props":4556,"children":4557},{"style":2254},[4558],{"type":47,"value":2418},{"type":41,"tag":1575,"props":4560,"children":4561},{"class":1577,"line":1723},[4562,4566,4570],{"type":41,"tag":1575,"props":4563,"children":4564},{"style":2254},[4565],{"type":47,"value":3107},{"type":41,"tag":1575,"props":4567,"children":4568},{"style":2243},[4569],{"type":47,"value":115},{"type":41,"tag":1575,"props":4571,"children":4572},{"style":2254},[4573],{"type":47,"value":2271},{"type":41,"tag":54,"props":4575,"children":4576},{},[4577,4582,4584,4589,4591,4597,4599,4605,4607,4613,4615,4621,4622,4628,4629,4635,4637,4643,4644,4650,4652,4661],{"type":41,"tag":69,"props":4578,"children":4580},{"className":4579},[],[4581],{"type":47,"value":453},{"type":47,"value":4583}," does ",{"type":41,"tag":58,"props":4585,"children":4586},{},[4587],{"type":47,"value":4588},"not",{"type":47,"value":4590}," use the stock ",{"type":41,"tag":69,"props":4592,"children":4594},{"className":4593},[],[4595],{"type":47,"value":4596},"postgres()",{"type":47,"value":4598}," factory — a Supabase app builds its client with the ",{"type":41,"tag":69,"props":4600,"children":4602},{"className":4601},[],[4603],{"type":47,"value":4604},"supabase()",{"type":47,"value":4606}," factory from ",{"type":41,"tag":69,"props":4608,"children":4610},{"className":4609},[],[4611],{"type":47,"value":4612},"@prisma-next\u002Fextension-supabase\u002Fruntime",{"type":47,"value":4614}," (role-first: ",{"type":41,"tag":69,"props":4616,"children":4618},{"className":4617},[],[4619],{"type":47,"value":4620},"asUser(jwt)",{"type":47,"value":1453},{"type":41,"tag":69,"props":4623,"children":4625},{"className":4624},[],[4626],{"type":47,"value":4627},"asAnon()",{"type":47,"value":1453},{"type":41,"tag":69,"props":4630,"children":4632},{"className":4631},[],[4633],{"type":47,"value":4634},"asServiceRole()",{"type":47,"value":4636},", JWT validation, RLS). That runtime — and RLS policy authoring (",{"type":41,"tag":69,"props":4638,"children":4640},{"className":4639},[],[4641],{"type":47,"value":4642},"policy_select",{"type":47,"value":1453},{"type":41,"tag":69,"props":4645,"children":4647},{"className":4646},[],[4648],{"type":47,"value":4649},"@@rls",{"type":47,"value":4651},") — is covered by ",{"type":41,"tag":58,"props":4653,"children":4654},{},[4655],{"type":41,"tag":69,"props":4656,"children":4658},{"className":4657},[],[4659],{"type":47,"value":4660},"prisma-next-supabase",{"type":47,"value":4662},"; load it for anything past the config wiring.",{"type":41,"tag":54,"props":4664,"children":4665},{},[4666,4668,4673,4674,4679,4680,4686,4688,4693],{"type":47,"value":4667},"Export subpaths: ",{"type":41,"tag":69,"props":4669,"children":4671},{"className":4670},[],[4672],{"type":47,"value":4185},{"type":47,"value":294},{"type":41,"tag":69,"props":4675,"children":4677},{"className":4676},[],[4678],{"type":47,"value":4612},{"type":47,"value":294},{"type":41,"tag":69,"props":4681,"children":4683},{"className":4682},[],[4684],{"type":47,"value":4685},"@prisma-next\u002Fextension-supabase\u002Fcontract",{"type":47,"value":4687},". Canonical worked example: ",{"type":41,"tag":69,"props":4689,"children":4691},{"className":4690},[],[4692],{"type":47,"value":4400},{"type":47,"value":198},{"type":41,"tag":238,"props":4695,"children":4697},{"id":4696},"workflow-brownfield-introspection",[4698],{"type":47,"value":4699},"Workflow — Brownfield introspection",{"type":41,"tag":54,"props":4701,"children":4702},{},[4703,4705,4711,4713,4718,4720,4725,4727,4733],{"type":47,"value":4704},"The concept: pull a contract source out of an existing database and continue from there. ",{"type":41,"tag":69,"props":4706,"children":4708},{"className":4707},[],[4709],{"type":47,"value":4710},"prisma-next contract infer --db \u003Curl>",{"type":47,"value":4712}," reads the live schema and writes a ",{"type":41,"tag":69,"props":4714,"children":4716},{"className":4715},[],[4717],{"type":47,"value":74},{"type":47,"value":4719}," file. It stops there — follow it with ",{"type":41,"tag":69,"props":4721,"children":4723},{"className":4722},[],[4724],{"type":47,"value":367},{"type":47,"value":4726}," and (when the schema matches a pinned hash) ",{"type":41,"tag":69,"props":4728,"children":4730},{"className":4729},[],[4731],{"type":47,"value":4732},"db sign",{"type":47,"value":4734}," as separate steps.",{"type":41,"tag":1564,"props":4736,"children":4738},{"className":1566,"code":4737,"language":1568,"meta":1569,"style":1569},"pnpm prisma-next contract infer --db $DATABASE_URL --output .\u002Fsrc\u002Fprisma\u002Fcontract.prisma\npnpm prisma-next contract emit\n",[4739],{"type":41,"tag":69,"props":4740,"children":4741},{"__ignoreMap":1569},[4742,4785],{"type":41,"tag":1575,"props":4743,"children":4744},{"class":1577,"line":1578},[4745,4750,4755,4760,4765,4770,4775,4780],{"type":41,"tag":1575,"props":4746,"children":4747},{"style":1582},[4748],{"type":47,"value":4749},"pnpm",{"type":41,"tag":1575,"props":4751,"children":4752},{"style":1588},[4753],{"type":47,"value":4754}," prisma-next",{"type":41,"tag":1575,"props":4756,"children":4757},{"style":1588},[4758],{"type":47,"value":4759}," contract",{"type":41,"tag":1575,"props":4761,"children":4762},{"style":1588},[4763],{"type":47,"value":4764}," infer",{"type":41,"tag":1575,"props":4766,"children":4767},{"style":1588},[4768],{"type":47,"value":4769}," --db",{"type":41,"tag":1575,"props":4771,"children":4772},{"style":2243},[4773],{"type":47,"value":4774}," $DATABASE_URL ",{"type":41,"tag":1575,"props":4776,"children":4777},{"style":1588},[4778],{"type":47,"value":4779},"--output",{"type":41,"tag":1575,"props":4781,"children":4782},{"style":1588},[4783],{"type":47,"value":4784}," .\u002Fsrc\u002Fprisma\u002Fcontract.prisma\n",{"type":41,"tag":1575,"props":4786,"children":4787},{"class":1577,"line":1668},[4788,4792,4796,4800],{"type":41,"tag":1575,"props":4789,"children":4790},{"style":1582},[4791],{"type":47,"value":4749},{"type":41,"tag":1575,"props":4793,"children":4794},{"style":1588},[4795],{"type":47,"value":4754},{"type":41,"tag":1575,"props":4797,"children":4798},{"style":1588},[4799],{"type":47,"value":4759},{"type":41,"tag":1575,"props":4801,"children":4802},{"style":1588},[4803],{"type":47,"value":4804}," emit\n",{"type":41,"tag":238,"props":4806,"children":4808},{"id":4807},"common-pitfalls",[4809],{"type":47,"value":662},{"type":41,"tag":86,"props":4811,"children":4812},{},[4813,4849,4871,4936,5042,5105],{"type":41,"tag":90,"props":4814,"children":4815},{},[4816,4821,4822,4827,4828,4833,4835,4841,4843,4848],{"type":41,"tag":58,"props":4817,"children":4818},{},[4819],{"type":47,"value":4820},"Forgetting to re-emit after an edit.",{"type":47,"value":900},{"type":41,"tag":69,"props":4823,"children":4825},{"className":4824},[],[4826],{"type":47,"value":188},{"type":47,"value":2180},{"type":41,"tag":69,"props":4829,"children":4831},{"className":4830},[],[4832],{"type":47,"value":207},{"type":47,"value":4834}," go stale; downstream typecheck and ",{"type":41,"tag":69,"props":4836,"children":4838},{"className":4837},[],[4839],{"type":47,"value":4840},"migration plan",{"type":47,"value":4842}," see the old shape. Re-emit, or install the Vite plugin (",{"type":41,"tag":69,"props":4844,"children":4846},{"className":4845},[],[4847],{"type":47,"value":157},{"type":47,"value":302},{"type":41,"tag":90,"props":4850,"children":4851},{},[4852,4857,4858,4863,4864,4869],{"type":41,"tag":58,"props":4853,"children":4854},{},[4855],{"type":47,"value":4856},"Editing the emitted artefacts.",{"type":47,"value":900},{"type":41,"tag":69,"props":4859,"children":4861},{"className":4860},[],[4862],{"type":47,"value":188},{"type":47,"value":2180},{"type":41,"tag":69,"props":4865,"children":4867},{"className":4866},[],[4868],{"type":47,"value":207},{"type":47,"value":4870}," are emitted; edits there round-trip away on the next emit. Edit the source.",{"type":41,"tag":90,"props":4872,"children":4873},{},[4874,4879,4880,4885,4886,4891,4892,4897,4898,4903,4905,4910,4911,4916,4918,4923,4924,4929,4930,4935],{"type":41,"tag":58,"props":4875,"children":4876},{},[4877],{"type":47,"value":4878},"Wrong factory\u002Fimport path for the TS builder.",{"type":47,"value":900},{"type":41,"tag":69,"props":4881,"children":4883},{"className":4882},[],[4884],{"type":47,"value":1015},{"type":47,"value":294},{"type":41,"tag":69,"props":4887,"children":4889},{"className":4888},[],[4890],{"type":47,"value":2141},{"type":47,"value":294},{"type":41,"tag":69,"props":4893,"children":4895},{"className":4894},[],[4896],{"type":47,"value":2148},{"type":47,"value":294},{"type":41,"tag":69,"props":4899,"children":4901},{"className":4900},[],[4902],{"type":47,"value":2155},{"type":47,"value":4904}," come from ",{"type":41,"tag":69,"props":4906,"children":4908},{"className":4907},[],[4909],{"type":47,"value":392},{"type":47,"value":745},{"type":41,"tag":69,"props":4912,"children":4914},{"className":4913},[],[4915],{"type":47,"value":576},{"type":47,"value":4917},"). Outside the callback overload, the available field constructors are ",{"type":41,"tag":69,"props":4919,"children":4921},{"className":4920},[],[4922],{"type":47,"value":2833},{"type":47,"value":294},{"type":41,"tag":69,"props":4925,"children":4927},{"className":4926},[],[4928],{"type":47,"value":2840},{"type":47,"value":294},{"type":41,"tag":69,"props":4931,"children":4933},{"className":4932},[],[4934],{"type":47,"value":2847},{"type":47,"value":198},{"type":41,"tag":90,"props":4937,"children":4938},{},[4939,4944,4946,4951,4952,4957,4958,4963,4965,4971,4972,4978,4980,4985,4986,4991,4992,4997,4998,5003,5004,5009,5010,5015,5017,5021,5023,5028,5030,5035,5036,5041],{"type":41,"tag":58,"props":4940,"children":4941},{},[4942],{"type":47,"value":4943},"Reaching into internal packages from user code.",{"type":47,"value":4945}," User-authored files (",{"type":41,"tag":69,"props":4947,"children":4949},{"className":4948},[],[4950],{"type":47,"value":173},{"type":47,"value":294},{"type":41,"tag":69,"props":4953,"children":4955},{"className":4954},[],[4956],{"type":47,"value":82},{"type":47,"value":294},{"type":41,"tag":69,"props":4959,"children":4961},{"className":4960},[],[4962],{"type":47,"value":453},{"type":47,"value":4964},", control clients) import only from ",{"type":41,"tag":69,"props":4966,"children":4968},{"className":4967},[],[4969],{"type":47,"value":4970},"@prisma-next\u002F\u003Ctarget>\u002F\u003Csubpath>",{"type":47,"value":2180},{"type":41,"tag":69,"props":4973,"children":4975},{"className":4974},[],[4976],{"type":47,"value":4977},"@prisma-next\u002Fextension-\u003Cname>\u002F\u003Csubpath>",{"type":47,"value":4979},". Imports from ",{"type":41,"tag":69,"props":4981,"children":4983},{"className":4982},[],[4984],{"type":47,"value":618},{"type":47,"value":294},{"type":41,"tag":69,"props":4987,"children":4989},{"className":4988},[],[4990],{"type":47,"value":625},{"type":47,"value":294},{"type":41,"tag":69,"props":4993,"children":4995},{"className":4994},[],[4996],{"type":47,"value":632},{"type":47,"value":294},{"type":41,"tag":69,"props":4999,"children":5001},{"className":5000},[],[5002],{"type":47,"value":639},{"type":47,"value":294},{"type":41,"tag":69,"props":5005,"children":5007},{"className":5006},[],[5008],{"type":47,"value":646},{"type":47,"value":353},{"type":41,"tag":69,"props":5011,"children":5013},{"className":5012},[],[5014],{"type":47,"value":653},{"type":47,"value":5016}," are framework-internal — the façade composes them for you. If a façade subpath you need is missing for your target, see ",{"type":41,"tag":375,"props":5018,"children":5019},{},[5020],{"type":47,"value":408},{"type":47,"value":5022}," and route to ",{"type":41,"tag":69,"props":5024,"children":5026},{"className":5025},[],[5027],{"type":47,"value":508},{"type":47,"value":5029},". The canonical worked examples are ",{"type":41,"tag":69,"props":5031,"children":5033},{"className":5032},[],[5034],{"type":47,"value":3250},{"type":47,"value":2180},{"type":41,"tag":69,"props":5037,"children":5039},{"className":5038},[],[5040],{"type":47,"value":3257},{"type":47,"value":198},{"type":41,"tag":90,"props":5043,"children":5044},{},[5045,5063,5065,5071,5073,5077,5079,5084,5086,5092,5094,5098,5099,5104],{"type":41,"tag":58,"props":5046,"children":5047},{},[5048,5050,5055,5057,5062],{"type":47,"value":5049},"Confusing the config ",{"type":41,"tag":69,"props":5051,"children":5053},{"className":5052},[],[5054],{"type":47,"value":844},{"type":47,"value":5056}," with the TS builder's ",{"type":41,"tag":69,"props":5058,"children":5060},{"className":5059},[],[5061],{"type":47,"value":844},{"type":47,"value":198},{"type":47,"value":5064}," Same packs, two surfaces, one field name but two shapes: ",{"type":41,"tag":69,"props":5066,"children":5068},{"className":5067},[],[5069],{"type":47,"value":5070},"defineConfig({ extensions: [pgvector] })",{"type":47,"value":5072}," (array of ",{"type":41,"tag":375,"props":5074,"children":5075},{},[5076],{"type":47,"value":992},{"type":47,"value":5078}," descriptors from ",{"type":41,"tag":69,"props":5080,"children":5082},{"className":5081},[],[5083],{"type":47,"value":1000},{"type":47,"value":5085},") versus ",{"type":41,"tag":69,"props":5087,"children":5089},{"className":5088},[],[5090],{"type":47,"value":5091},"defineContract({ extensions: { pgvector } })",{"type":47,"value":5093}," (record of ",{"type":41,"tag":375,"props":5095,"children":5096},{},[5097],{"type":47,"value":1038},{"type":47,"value":5078},{"type":41,"tag":69,"props":5100,"children":5102},{"className":5101},[],[5103],{"type":47,"value":1045},{"type":47,"value":302},{"type":41,"tag":90,"props":5106,"children":5107},{},[5108,5113,5115,5120,5122,5127,5129,5134],{"type":41,"tag":58,"props":5109,"children":5110},{},[5111],{"type":47,"value":5112},"Renaming a field and expecting the planner to detect it.",{"type":47,"value":5114}," Prisma Next has no in-contract rename hint; the planner sees a destructive drop+add. Hand-edit ",{"type":41,"tag":69,"props":5116,"children":5118},{"className":5117},[],[5119],{"type":47,"value":129},{"type":47,"value":5121}," after ",{"type":41,"tag":69,"props":5123,"children":5125},{"className":5124},[],[5126],{"type":47,"value":4840},{"type":47,"value":5128}," (see ",{"type":41,"tag":69,"props":5130,"children":5132},{"className":5131},[],[5133],{"type":47,"value":113},{"type":47,"value":5135},"), or use the keep-then-drop two-migration pattern.",{"type":41,"tag":238,"props":5137,"children":5139},{"id":5138},"what-prisma-next-doesnt-do-yet",[5140],{"type":47,"value":408},{"type":41,"tag":177,"props":5142,"children":5143},{},[5144,5174,5198,5235,5266,5282],{"type":41,"tag":90,"props":5145,"children":5146},{},[5147,5152,5154,5160,5162,5166,5168,5173],{"type":41,"tag":58,"props":5148,"children":5149},{},[5150],{"type":47,"value":5151},"In-contract rename hint.",{"type":47,"value":5153}," No ",{"type":41,"tag":69,"props":5155,"children":5157},{"className":5156},[],[5158],{"type":47,"value":5159},"@@rename(old: ..., new: ...)",{"type":47,"value":5161}," or similar. Use the workarounds in ",{"type":41,"tag":375,"props":5163,"children":5164},{},[5165],{"type":47,"value":662},{"type":47,"value":5167}," #6. To request first-class rename, file via ",{"type":41,"tag":69,"props":5169,"children":5171},{"className":5170},[],[5172],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":90,"props":5175,"children":5176},{},[5177,5182,5184,5190,5192,5197],{"type":41,"tag":58,"props":5178,"children":5179},{},[5180],{"type":47,"value":5181},"Model validations.",{"type":47,"value":5183}," No declarative ",{"type":41,"tag":69,"props":5185,"children":5187},{"className":5186},[],[5188],{"type":47,"value":5189},"@validates(...)",{"type":47,"value":5191}," surface. Validate in application code (arktype). To request declarative validations in the contract, file via ",{"type":41,"tag":69,"props":5193,"children":5195},{"className":5194},[],[5196],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":90,"props":5199,"children":5200},{},[5201,5206,5207,5213,5214,5220,5222,5227,5229,5234],{"type":41,"tag":58,"props":5202,"children":5203},{},[5204],{"type":47,"value":5205},"Lifecycle callbacks",{"type":47,"value":107},{"type":41,"tag":69,"props":5208,"children":5210},{"className":5209},[],[5211],{"type":47,"value":5212},"beforeSave",{"type":47,"value":294},{"type":41,"tag":69,"props":5215,"children":5217},{"className":5216},[],[5218],{"type":47,"value":5219},"afterCreate",{"type":47,"value":5221},", etc.). Not supported. Use middleware (",{"type":41,"tag":69,"props":5223,"children":5225},{"className":5224},[],[5226],{"type":47,"value":461},{"type":47,"value":5228},") or app code. To request lifecycle callbacks, file via ",{"type":41,"tag":69,"props":5230,"children":5232},{"className":5231},[],[5233],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":90,"props":5236,"children":5237},{},[5238,5250,5252,5258,5260,5265],{"type":41,"tag":58,"props":5239,"children":5240},{},[5241,5243,5249],{"type":47,"value":5242},"Soft delete \u002F ",{"type":41,"tag":69,"props":5244,"children":5246},{"className":5245},[],[5247],{"type":47,"value":5248},"paranoid: true",{"type":47,"value":198},{"type":47,"value":5251}," No built-in soft-delete column. Add a nullable ",{"type":41,"tag":69,"props":5253,"children":5255},{"className":5254},[],[5256],{"type":47,"value":5257},"deletedAt DateTime?",{"type":47,"value":5259}," and filter explicitly in queries (or in middleware). To request built-in soft delete, file via ",{"type":41,"tag":69,"props":5261,"children":5263},{"className":5262},[],[5264],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":90,"props":5267,"children":5268},{},[5269,5274,5276,5281],{"type":41,"tag":58,"props":5270,"children":5271},{},[5272],{"type":47,"value":5273},"Scopes \u002F default filters.",{"type":47,"value":5275}," No ActiveRecord-style scopes. Compose query helpers yourself. To request scopes, file via ",{"type":41,"tag":69,"props":5277,"children":5279},{"className":5278},[],[5280],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":90,"props":5283,"children":5284},{},[5285,5290,5292,5297],{"type":41,"tag":58,"props":5286,"children":5287},{},[5288],{"type":47,"value":5289},"Implicit Prisma-ORM many-to-many.",{"type":47,"value":5291}," List navigation on both sides without an explicit join model is rejected. Author the join model explicitly. To request implicit M2M, file via ",{"type":41,"tag":69,"props":5293,"children":5295},{"className":5294},[],[5296],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":238,"props":5299,"children":5301},{"id":5300},"reference",[5302],{"type":47,"value":5303},"Reference",{"type":41,"tag":177,"props":5305,"children":5306},{},[5307,5320,5332,5343],{"type":41,"tag":90,"props":5308,"children":5309},{},[5310,5312,5318],{"type":47,"value":5311},"Run ",{"type":41,"tag":69,"props":5313,"children":5315},{"className":5314},[],[5316],{"type":47,"value":5317},"pnpm prisma-next contract --help",{"type":47,"value":5319}," for the live command surface.",{"type":41,"tag":90,"props":5321,"children":5322},{},[5323,5325,5331],{"type":47,"value":5324},"PSL feature surface and what the interpreter accepts: ",{"type":41,"tag":69,"props":5326,"children":5328},{"className":5327},[],[5329],{"type":47,"value":5330},"packages\u002F2-sql\u002F2-authoring\u002Fcontract-psl\u002FREADME.md",{"type":47,"value":198},{"type":41,"tag":90,"props":5333,"children":5334},{},[5335,5337,5342],{"type":47,"value":5336},"TS builder surface and the callback-helper vocabulary: ",{"type":41,"tag":69,"props":5338,"children":5340},{"className":5339},[],[5341],{"type":47,"value":1986},{"type":47,"value":198},{"type":41,"tag":90,"props":5344,"children":5345},{},[5346,5348,5353,5354,5359,5360,5365,5367,5372,5374],{"type":47,"value":5347},"Layouts (where ",{"type":41,"tag":69,"props":5349,"children":5351},{"className":5350},[],[5352],{"type":47,"value":74},{"type":47,"value":294},{"type":41,"tag":69,"props":5355,"children":5357},{"className":5356},[],[5358],{"type":47,"value":188},{"type":47,"value":294},{"type":41,"tag":69,"props":5361,"children":5363},{"className":5362},[],[5364],{"type":47,"value":207},{"type":47,"value":5366},", and ",{"type":41,"tag":69,"props":5368,"children":5370},{"className":5369},[],[5371],{"type":47,"value":1076},{"type":47,"value":5373}," live):\n",{"type":41,"tag":177,"props":5375,"children":5376},{},[5377,5408],{"type":41,"tag":90,"props":5378,"children":5379},{},[5380,5385,5386,5392,5393,5399,5401,5406],{"type":41,"tag":58,"props":5381,"children":5382},{},[5383],{"type":47,"value":5384},"App layout",{"type":47,"value":107},{"type":41,"tag":69,"props":5387,"children":5389},{"className":5388},[],[5390],{"type":47,"value":5391},"src\u002Fprisma\u002F...",{"type":47,"value":922},{"type":41,"tag":69,"props":5394,"children":5396},{"className":5395},[],[5397],{"type":47,"value":5398},"migrations\u002Fapp\u002F...",{"type":47,"value":5400},") — what ",{"type":41,"tag":69,"props":5402,"children":5404},{"className":5403},[],[5405],{"type":47,"value":1166},{"type":47,"value":5407}," demonstrates; the canonical shape consuming applications use.",{"type":41,"tag":90,"props":5409,"children":5410},{},[5411,5415,5416,5421,5423,5428,5430,5435],{"type":41,"tag":58,"props":5412,"children":5413},{},[5414],{"type":47,"value":1192},{"type":47,"value":107},{"type":41,"tag":69,"props":5417,"children":5419},{"className":5418},[],[5420],{"type":47,"value":1214},{"type":47,"value":5422}," directly, ",{"type":41,"tag":69,"props":5424,"children":5426},{"className":5425},[],[5427],{"type":47,"value":1237},{"type":47,"value":5429}," without a space-id segment) — for extensions and aggregate-root packages, documented in ",{"type":41,"tag":69,"props":5431,"children":5433},{"className":5432},[],[5434],{"type":47,"value":1267},{"type":47,"value":1269},{"type":41,"tag":238,"props":5437,"children":5439},{"id":5438},"checklist",[5440],{"type":47,"value":5441},"Checklist",{"type":41,"tag":177,"props":5443,"children":5446},{"className":5444},[5445],"contains-task-list",[5447,5485,5551,5573,5610,5632,5648,5670,5697],{"type":41,"tag":90,"props":5448,"children":5451},{"className":5449},[5450],"task-list-item",[5452,5457,5459,5464,5466,5471,5472,5477,5479,5484],{"type":41,"tag":5453,"props":5454,"children":5456},"input",{"disabled":1699,"type":5455},"checkbox",[],{"type":47,"value":5458}," Read ",{"type":41,"tag":69,"props":5460,"children":5462},{"className":5461},[],[5463],{"type":47,"value":173},{"type":47,"value":5465}," and identified the contract source (path string ending in ",{"type":41,"tag":69,"props":5467,"children":5469},{"className":5468},[],[5470],{"type":47,"value":714},{"type":47,"value":817},{"type":41,"tag":69,"props":5473,"children":5475},{"className":5474},[],[5476],{"type":47,"value":766},{"type":47,"value":5478},") and the installed ",{"type":41,"tag":69,"props":5480,"children":5482},{"className":5481},[],[5483],{"type":47,"value":313},{"type":47,"value":198},{"type":41,"tag":90,"props":5486,"children":5488},{"className":5487},[5450],[5489,5492,5494,5499,5500,5505,5507,5512,5514,5519,5520,5525,5526,5531,5532,5537,5538,5543,5544,5549],{"type":41,"tag":5453,"props":5490,"children":5491},{"disabled":1699,"type":5455},[],{"type":47,"value":5493}," All user-authored imports resolve to ",{"type":41,"tag":69,"props":5495,"children":5497},{"className":5496},[],[5498],{"type":47,"value":4970},{"type":47,"value":875},{"type":41,"tag":69,"props":5501,"children":5503},{"className":5502},[],[5504],{"type":47,"value":385},{"type":47,"value":5506},") or ",{"type":41,"tag":69,"props":5508,"children":5510},{"className":5509},[],[5511],{"type":47,"value":4977},{"type":47,"value":5513},". No imports from ",{"type":41,"tag":69,"props":5515,"children":5517},{"className":5516},[],[5518],{"type":47,"value":618},{"type":47,"value":294},{"type":41,"tag":69,"props":5521,"children":5523},{"className":5522},[],[5524],{"type":47,"value":625},{"type":47,"value":294},{"type":41,"tag":69,"props":5527,"children":5529},{"className":5528},[],[5530],{"type":47,"value":632},{"type":47,"value":294},{"type":41,"tag":69,"props":5533,"children":5535},{"className":5534},[],[5536],{"type":47,"value":639},{"type":47,"value":294},{"type":41,"tag":69,"props":5539,"children":5541},{"className":5540},[],[5542],{"type":47,"value":646},{"type":47,"value":353},{"type":41,"tag":69,"props":5545,"children":5547},{"className":5546},[],[5548],{"type":47,"value":653},{"type":47,"value":5550}," in user files.",{"type":41,"tag":90,"props":5552,"children":5554},{"className":5553},[5450],[5555,5558,5560,5565,5566,5571],{"type":41,"tag":5453,"props":5556,"children":5557},{"disabled":1699,"type":5455},[],{"type":47,"value":5559}," Edited the contract source (",{"type":41,"tag":69,"props":5561,"children":5563},{"className":5562},[],[5564],{"type":47,"value":74},{"type":47,"value":817},{"type":41,"tag":69,"props":5567,"children":5569},{"className":5568},[],[5570],{"type":47,"value":82},{"type":47,"value":5572},"), not an emitted artefact.",{"type":41,"tag":90,"props":5574,"children":5576},{"className":5575},[5450],[5577,5580,5582,5587,5589,5594,5595,5600,5602,5608],{"type":41,"tag":5453,"props":5578,"children":5579},{"disabled":1699,"type":5455},[],{"type":47,"value":5581}," For new extension namespaces: added the package, imported its control descriptor (",{"type":41,"tag":69,"props":5583,"children":5585},{"className":5584},[],[5586],{"type":47,"value":1000},{"type":47,"value":5588},"), added it to ",{"type":41,"tag":69,"props":5590,"children":5592},{"className":5591},[],[5593],{"type":47,"value":313},{"type":47,"value":167},{"type":41,"tag":69,"props":5596,"children":5598},{"className":5597},[],[5599],{"type":47,"value":788},{"type":47,"value":5601}," (and the matching pack descriptor to ",{"type":41,"tag":69,"props":5603,"children":5605},{"className":5604},[],[5606],{"type":47,"value":5607},"defineContract({extensions: {...}})",{"type":47,"value":5609}," if using the TS builder).",{"type":41,"tag":90,"props":5611,"children":5613},{"className":5612},[5450],[5614,5617,5619,5624,5625,5630],{"type":41,"tag":5453,"props":5615,"children":5616},{"disabled":1699,"type":5455},[],{"type":47,"value":5618}," For renames: hand-edited ",{"type":41,"tag":69,"props":5620,"children":5622},{"className":5621},[],[5623],{"type":47,"value":129},{"type":47,"value":5121},{"type":41,"tag":69,"props":5626,"children":5628},{"className":5627},[],[5629],{"type":47,"value":4840},{"type":47,"value":5631}," (or used the keep-then-drop two-migration pattern) — Prisma Next has no rename hint today.",{"type":41,"tag":90,"props":5633,"children":5635},{"className":5634},[5450],[5636,5639,5641,5646],{"type":41,"tag":5453,"props":5637,"children":5638},{"disabled":1699,"type":5455},[],{"type":47,"value":5640}," Ran ",{"type":41,"tag":69,"props":5642,"children":5644},{"className":5643},[],[5645],{"type":47,"value":1792},{"type":47,"value":5647}," after the edit (or let the Vite plugin re-emit on save).",{"type":41,"tag":90,"props":5649,"children":5651},{"className":5650},[5450],[5652,5655,5657,5662,5663,5668],{"type":41,"tag":5453,"props":5653,"children":5654},{"disabled":1699,"type":5455},[],{"type":47,"value":5656}," Confirmed ",{"type":41,"tag":69,"props":5658,"children":5660},{"className":5659},[],[5661],{"type":47,"value":188},{"type":47,"value":2180},{"type":41,"tag":69,"props":5664,"children":5666},{"className":5665},[],[5667],{"type":47,"value":207},{"type":47,"value":5669}," updated next to the source.",{"type":41,"tag":90,"props":5671,"children":5673},{"className":5672},[5450],[5674,5677,5679,5683,5685,5690,5691,5696],{"type":41,"tag":5453,"props":5675,"children":5676},{"disabled":1699,"type":5455},[],{"type":47,"value":5678}," Did ",{"type":41,"tag":58,"props":5680,"children":5681},{},[5682],{"type":47,"value":4588},{"type":47,"value":5684}," hand-edit ",{"type":41,"tag":69,"props":5686,"children":5688},{"className":5687},[],[5689],{"type":47,"value":188},{"type":47,"value":1453},{"type":41,"tag":69,"props":5692,"children":5694},{"className":5693},[],[5695],{"type":47,"value":207},{"type":47,"value":198},{"type":41,"tag":90,"props":5698,"children":5700},{"className":5699},[5450],[5701,5704,5705,5709,5711,5715,5716,5721],{"type":41,"tag":5453,"props":5702,"children":5703},{"disabled":1699,"type":5455},[],{"type":47,"value":5678},{"type":41,"tag":58,"props":5706,"children":5707},{},[5708],{"type":47,"value":4588},{"type":47,"value":5710}," confabulate a missing feature (validations, callbacks, soft delete, scopes, in-contract rename hint) — referred the user to ",{"type":41,"tag":375,"props":5712,"children":5713},{},[5714],{"type":47,"value":408},{"type":47,"value":922},{"type":41,"tag":69,"props":5717,"children":5719},{"className":5718},[],[5720],{"type":47,"value":508},{"type":47,"value":198},{"type":41,"tag":5723,"props":5724,"children":5725},"style",{},[5726],{"type":47,"value":5727},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5729,"total":2799},[5730,5743,5757,5764,5776,5789,5807,5817,5831,5843,5853,5866],{"slug":5731,"name":5731,"fn":5732,"description":5733,"org":5734,"tags":5735,"stars":23,"repoUrl":24,"updatedAt":5742},"prisma-next","guide Prisma Next project setup and usage","Route a vague Prisma Next prompt to the right specific skill. Use for \"help me with Prisma Next\", \"what is Prisma Next\", \"explain Prisma Next\", \"I'm new to PN\", \"where do I start\", \"what can I do with Prisma Next\", \"what can I do next with Prisma\", \"just ran createprisma\", \"tour of Prisma Next\", \"Prisma Next overview\", and comparison questions like \"Prisma Next vs Prisma 7\", \"PN vs Drizzle\", \"PN vs Kysely\", \"PN vs TypeORM\". Do NOT use when the prompt clearly matches a workflow skill — adoption \u002F quickstart \u002F first-touch orientation \u002F brownfield introspection, schema \u002F contract editing, migration authoring (db update \u002F migration plan \u002F migrate), migration review on deploy \u002F concurrent migrations, queries \u002F db.orm \u002F db.sql \u002F TypedSQL, Supabase \u002F RLS \u002F role binding, runtime \u002F db.ts \u002F middleware wiring, build \u002F Vite plugin \u002F Next.js plugin, debug \u002F structured error envelopes \u002F PN-* error codes, or feedback \u002F bug report \u002F feature request — load that sibling skill directly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5736,5737,5740,5741],{"name":17,"slug":18,"type":15},{"name":5738,"slug":5739,"type":15},"Next.js","next-js",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-17T05:32:04.322957",{"slug":157,"name":157,"fn":5744,"description":5745,"org":5746,"tags":5747,"stars":23,"repoUrl":24,"updatedAt":5756},"integrate Prisma Next into build systems","Wire Prisma Next into the project's build system with the right build-tool plugin — Vite today via @prisma-next\u002Fvite-plugin-contract-emit (Vite 7 \u002F 8); Next.js \u002F Webpack \u002F esbuild \u002F Rollup \u002F Turbopack are named as gaps rather than fabricated. Always offers the Vite plugin proactively when the project is using Vite. Use for vite plugin, vite-plugin, vite.config.ts, prismaVitePlugin, contract emit on save, HMR, hot reload contract, dev server, Next.js plugin, next plugin, withPrismaNext, webpack plugin, esbuild plugin, rollup plugin, build integration, dev server plugin, vite 7, vite 8.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5748,5751,5752,5753],{"name":5749,"slug":5750,"type":15},"Deployment","deployment",{"name":5738,"slug":5739,"type":15},{"name":9,"slug":8,"type":15},{"name":5754,"slug":5755,"type":15},"Vite","vite","2026-07-02T07:31:36.108254",{"slug":4,"name":4,"fn":5,"description":6,"org":5758,"tags":5759,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5760,5761,5762,5763],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":496,"name":496,"fn":5765,"description":5766,"org":5767,"tags":5768,"stars":23,"repoUrl":24,"updatedAt":5775},"debug and recover from Prisma Next errors","Read a Prisma Next structured error envelope and route to the right recovery — code, domain, severity, why, fix, meta. Use for error, exception, my emit failed, my query won't typecheck, my query crashed, my migration won't apply, MIGRATION.HASH_MISMATCH, BUDGET.ROWS_EXCEEDED, BUDGET.TIME_EXCEEDED, RUNTIME.ABORTED, PLAN.HASH_MISMATCH, CONTRACT.MARKER_MISSING, PN-RUN-3001, PN-RUN-3002, PN-RUN-3030, PN-MIG-2001, PN-CLI-4011, PN-SCHEMA-0001, drift, capability missing, planner conflict, prisma studio, EXPLAIN, query log, db.end, db.close, script won't exit, hangs, close connection, pool.end, client is closed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5769,5770,5773,5774],{"name":17,"slug":18,"type":15},{"name":5771,"slug":5772,"type":15},"Debugging","debugging",{"name":5738,"slug":5739,"type":15},{"name":9,"slug":8,"type":15},"2026-07-24T05:37:10.436314",{"slug":508,"name":508,"fn":5777,"description":5778,"org":5779,"tags":5780,"stars":23,"repoUrl":24,"updatedAt":5788},"report Prisma Next issues and feedback","Hand a Prisma Next question or report off to the team — file a GitHub issue (bug or feature request), or route Q&A \u002F design discussion \u002F direct-team-contact to the Prisma Discord at pris.ly\u002Fdiscord. Use for bug, bug report, file an issue, report a bug, feature request, missing feature, this should be a feature, file this, this is a bug, this is broken, surprising behaviour, this doesn't work, file feedback, send feedback, capability gap, file via prisma-next-feedback, ask the team, talk to the team, talk to the Prisma team, talk to Prisma, Discord, Prisma Discord, Q&A, design feedback, is this the intended way, how should I do X, extension author question, extension author needs help.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5781,5784,5787],{"name":5782,"slug":5783,"type":15},"Documentation","documentation",{"name":5785,"slug":5786,"type":15},"GitHub","github",{"name":9,"slug":8,"type":15},"2026-07-02T07:31:34.870809",{"slug":5790,"name":5790,"fn":5791,"description":5792,"org":5793,"tags":5794,"stars":23,"repoUrl":24,"updatedAt":5806},"prisma-next-migration-review","review and resolve Prisma Next migrations","Review what Prisma Next migrations will run on merge or deploy, render the migration graph, resolve concurrent \u002F diamond-convergence conflicts, and configure environment refs for CI. Use for \"what migrations are going to run\", \"what runs on deploy\", merge conflict, diamond convergence, concurrent migrations, migration status, ref management, staging, production, MIGRATION.DIVERGED, MIGRATION.NO_MARKER, MIGRATION.MARKER_NOT_IN_HISTORY, prisma migrate status, prisma migrate diff, prisma migrate resolve.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5795,5798,5801,5802,5805],{"name":5796,"slug":5797,"type":15},"CI\u002FCD","ci-cd",{"name":5799,"slug":5800,"type":15},"Code Review","code-review",{"name":17,"slug":18,"type":15},{"name":5803,"slug":5804,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-07-24T05:37:11.422323",{"slug":113,"name":113,"fn":5808,"description":5809,"org":5810,"tags":5811,"stars":23,"repoUrl":24,"updatedAt":5816},"author and manage Prisma Next migrations","Author Prisma Next migrations — choose db update vs migration plan, edit the framework-rendered migration.ts (replace placeholder sentinels with dataTransform closures), recover from MIGRATION.HASH_MISMATCH or PN-MIG-2001 unfilled placeholder. Use for prisma migrate dev, prisma migrate deploy, prisma db push, db update, db update --dry-run, migration plan, migrate, migration new, migration show, db verify, db sign, data migration, this.dataTransform, dataTransform, placeholder, generated migration.ts, edit migration.ts, MIGRATION.HASH_MISMATCH, schema drift.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5812,5813,5814,5815],{"name":17,"slug":18,"type":15},{"name":5803,"slug":5804,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-24T05:37:13.469138",{"slug":441,"name":441,"fn":5818,"description":5819,"org":5820,"tags":5821,"stars":23,"repoUrl":24,"updatedAt":5830},"write Prisma Next queries for database operations","Write Prisma Next queries for Postgres, SQLite, or Mongo — pick a lane (Postgres\u002FSQLite `db.orm.\u003CModel>` + `db.sql.\u003Ctable>`; Mongo `db.orm.\u003Croot>` + `db.query.from(...)` pipeline builder), filter \u002F project \u002F sort \u002F paginate, eager-load with `.include(...)`, Postgres\u002FSQLite `db.transaction(...)`, Postgres\u002FSQLite ORM `.aggregate(...)`, Mongo aggregations via query builder, namespace-aware accessors (`db.orm.\u003Cns>.\u003CModel>`, `db.sql.\u003Cns>.\u003Ctable>`). Triggers: query, where, match, select, project, orderBy, take, skip, include, lookup, first, all, count, aggregate, group, create, update, delete, upsert, returning, transaction, db.close, script teardown, variant, polymorphism, drizzle-style, kysely-style. Notes: `.all()` is a Thenable (just `await` it), iterators are single-use (`RUNTIME.ITERATOR_CONSUMED`), Postgres `count` is `number` while sum\u002Favg\u002Fmin\u002Fmax are `number | null`, ranges use chained `.where()` or `and(...)` (no `.between(...)`).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5822,5823,5824,5827,5828],{"name":17,"slug":18,"type":15},{"name":5738,"slug":5739,"type":15},{"name":5825,"slug":5826,"type":15},"PostgreSQL","postgresql",{"name":9,"slug":8,"type":15},{"name":5829,"slug":2727,"type":15},"SQL","2026-07-17T05:32:03.35373",{"slug":484,"name":484,"fn":5832,"description":5833,"org":5834,"tags":5835,"stars":23,"repoUrl":24,"updatedAt":5842},"adopt Prisma Next in projects","Adopt Prisma Next into a new project, onto an existing database, or as the first move after a bootstrap tool dropped you into a scaffold. Use for \"what can I do with Prisma Next\", \"what can I do next with Prisma\", \"where do I start\", \"what should I do first\", \"just ran createprisma\", \"createprisma\", \"npx createprisma\", \"npx create-prisma\", \"first steps\", \"first query\", \"I have a scaffolded Prisma Next project what now\"; for `pnpm dlx prisma-next init` greenfield setup; and for `prisma-next contract infer` + `db sign` against an existing database. Also covers the connect-write-read first-arc orientation, the day-to-day commands (`contract emit`, `db init`, `db update`, `migration plan`, `migrate`, `db schema`, `db verify`), and routing to `prisma-next-contract` \u002F `prisma-next-queries` \u002F `prisma-next-runtime` for the next move. Flags: --target, --authoring, --schema-path, --probe-db, --output.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5836,5837,5840,5841],{"name":17,"slug":18,"type":15},{"name":5838,"slug":5839,"type":15},"ORM","orm",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},"2026-07-24T05:37:12.462072",{"slug":461,"name":461,"fn":5844,"description":5845,"org":5846,"tags":5847,"stars":23,"repoUrl":24,"updatedAt":5852},"configure Prisma Next runtime and database connections","Wire the Prisma Next runtime — `db.ts` setup using `postgres\u003CContract>(...)` from `@prisma-next\u002Fpostgres\u002Fruntime`, `sqlite\u003CContract>(...)` from `@prisma-next\u002Fsqlite\u002Fruntime`, or `mongo\u003CContract>(...)` from `@prisma-next\u002Fmongo\u002Fruntime`; middleware composition (telemetry from `@prisma-next\u002Fmiddleware-telemetry`; lints and budgets), `DATABASE_URL` config, per-environment branching, switching between Postgres, SQLite, and Mongo façades. Use for db.ts, postgres(), sqlite(), mongo(), middleware, telemetry, lints, budgets, DATABASE_URL, .env, connection pool, poolOptions, dev vs prod config, transactions, db.transaction, read replicas, multi-database, script won't exit, hangs, close connection, db.end, db.close, pool.end, [Symbol.asyncDispose], await using.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5848,5849,5850,5851],{"name":17,"slug":18,"type":15},{"name":5738,"slug":5739,"type":15},{"name":5825,"slug":5826,"type":15},{"name":9,"slug":8,"type":15},"2026-07-17T05:32:05.347316",{"slug":4660,"name":4660,"fn":5854,"description":5855,"org":5856,"tags":5857,"stars":23,"repoUrl":24,"updatedAt":5865},"integrate Prisma with Supabase","Use Prisma Next with a Supabase project via `@prisma-next\u002Fextension-supabase` — wire `extensions: [supabasePack]`, declare cross-space FKs to `supabase:auth.AuthUser`, author RLS policies (`policy_select` \u002F `policy_update` \u002F `@@rls`, `auth.uid()` predicates), build `db.ts` with the `supabase()` factory, bind roles per request (`asUser(jwt)` \u002F `asAnon()` \u002F `asServiceRole()`), query `auth.*` \u002F `storage.*` via the `db.asServiceRole().supabase` admin root, and validate JWTs (`jwksUrl` for current projects \u002F `jwtSecret` for legacy HS256). Use for supabase, RLS, row level security, policy, role binding, anon, authenticated, service_role, auth.users, auth.uid(), JWT, JWKS, SUPABASE_JWKS_URL, SUPABASE_JWT_SECRET, SUPABASE.JWT_INVALID, SUPABASE.CONFIG_INVALID, RoleBoundDb, session pooler, supabase:auth.AuthUser, @prisma-next\u002Fextension-supabase.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5858,5860,5861,5862,5863],{"name":5859,"slug":4169,"type":15},"Auth",{"name":5838,"slug":5839,"type":15},{"name":5825,"slug":5826,"type":15},{"name":9,"slug":8,"type":15},{"name":5864,"slug":4177,"type":15},"Supabase","2026-07-30T05:30:11.065251",{"slug":5867,"name":5867,"fn":5868,"description":5869,"org":5870,"tags":5871,"stars":5879,"repoUrl":5880,"updatedAt":5881},"prisma-cli","run Prisma CLI commands","Prisma ORM CLI commands reference covering init, generate, migrate, db, dev, studio, validate, format, debug, and mcp. Use for ORM\u002Fdatabase CLI workflows, not Prisma Compute app deployment. For Prisma Compute, `@prisma\u002Fcli app deploy`, `compute:deploy`, `create-prisma --deploy`, apps, deployments, logs, or domains, use the `prisma-compute` skill instead. Triggers on \"prisma init\", \"prisma generate\", \"prisma migrate\", \"prisma db\", \"prisma studio\", \"prisma mcp\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5872,5875,5876,5877,5878],{"name":5873,"slug":5874,"type":15},"CLI","cli",{"name":17,"slug":18,"type":15},{"name":5803,"slug":5804,"type":15},{"name":5838,"slug":5839,"type":15},{"name":9,"slug":8,"type":15},44,"https:\u002F\u002Fgithub.com\u002Fprisma\u002Fskills","2026-04-06T18:48:29.140467",{"items":5883,"total":1750},[5884,5891,5898,5905,5912,5918,5926],{"slug":5731,"name":5731,"fn":5732,"description":5733,"org":5885,"tags":5886,"stars":23,"repoUrl":24,"updatedAt":5742},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5887,5888,5889,5890],{"name":17,"slug":18,"type":15},{"name":5738,"slug":5739,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":157,"name":157,"fn":5744,"description":5745,"org":5892,"tags":5893,"stars":23,"repoUrl":24,"updatedAt":5756},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5894,5895,5896,5897],{"name":5749,"slug":5750,"type":15},{"name":5738,"slug":5739,"type":15},{"name":9,"slug":8,"type":15},{"name":5754,"slug":5755,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":5899,"tags":5900,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5901,5902,5903,5904],{"name":20,"slug":21,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":496,"name":496,"fn":5765,"description":5766,"org":5906,"tags":5907,"stars":23,"repoUrl":24,"updatedAt":5775},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5908,5909,5910,5911],{"name":17,"slug":18,"type":15},{"name":5771,"slug":5772,"type":15},{"name":5738,"slug":5739,"type":15},{"name":9,"slug":8,"type":15},{"slug":508,"name":508,"fn":5777,"description":5778,"org":5913,"tags":5914,"stars":23,"repoUrl":24,"updatedAt":5788},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5915,5916,5917],{"name":5782,"slug":5783,"type":15},{"name":5785,"slug":5786,"type":15},{"name":9,"slug":8,"type":15},{"slug":5790,"name":5790,"fn":5791,"description":5792,"org":5919,"tags":5920,"stars":23,"repoUrl":24,"updatedAt":5806},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5921,5922,5923,5924,5925],{"name":5796,"slug":5797,"type":15},{"name":5799,"slug":5800,"type":15},{"name":17,"slug":18,"type":15},{"name":5803,"slug":5804,"type":15},{"name":9,"slug":8,"type":15},{"slug":113,"name":113,"fn":5808,"description":5809,"org":5927,"tags":5928,"stars":23,"repoUrl":24,"updatedAt":5816},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5929,5930,5931,5932],{"name":17,"slug":18,"type":15},{"name":5803,"slug":5804,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15}]