Skip to content

Commit 7ed0d25

Browse files
nurul3101claudeankur-arch
authored
Prisma Next Post Merge Polish (#8043)
* docs(orm/next): correct MongoDB where() filter and array-op claims in fundamentals reading-data: MongoDB where() also accepts MongoFieldFilter expressions (comparisons, .and()/.not(), MongoOrExpr.of), not the object form only; link to the reference filter section. writing-data: stop presenting .push() as plainly usable; the reference marks array operations as unverified. Point to a verified op instead and link to the field-operations reference section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(eclipse): stop tabbed code blocks overlapping the tab list The general Tabs' TabsContent kept fumadocs' [&>figure:only-child]:-m-4 bleed, but unlike fumadocs (and the padded codetabs variant) its container has no padding to compensate, so a lone code block was pulled 1rem up over the PostgreSQL/MongoDB tab triggers on every tab= code fence. Replace the bleed with a snug mt-2/mb-0 so the code block sits below the tab row. Also remove two console.log calls that fired on every npm-tab interaction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(next): consistency pass over the merged /orm/next content - Convert pure-code <Tabs> blocks in contract-authoring to tab= fences (house convention; the one prose-bearing pair stays a component). - Fix db.sql.public.postTag -> post_tag in advanced-queries (mapped table names are snake_case) and align the accessor wording with the reference. - Correct the contract-artifact roots explanation to cover both the SQL table accessor (root key) and the ORM accessor (model name). - Rescope the TypeScript-builder relation-target claim: PG takes model objects, MongoDB takes type-checked model names. - Add badge: early-access to the fundamentals and contract-authoring pages (every other Prisma Next page carries it). - Use "contract" (not "schema") for the authored artifact in data-modeling/index and how-migrations-work. - Name the RUNTIME.ITERATOR_CONSUMED code in reading-data's streaming note. - Normalize create-prisma -> create-prisma@next across the section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(orm/next): remove outdated MongoDB field operation example in writing-data * docs(orm/next): apply post-merge writing polish across Prisma Next docs - Rewrite the-migration-graph page around the real problem (branches merge, every database must catch up): user-problem opening, "When this matters", a terms glossary, an Alice/Bob phone+avatarUrl worked example, an explicit "What happens when you run migrate" list, task-oriented command tables, a "Common tasks" section before the agent prompts, a tip box, and impact-framed early-access limitations. Drop clever phrasing. - Replace question-style openers ("New to X? Start with...") with direct phrasing across data-modeling and contract-authoring pages. - Normalize every "Prompt your coding agent" section to link [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next). - Break the ops.json operation paragraph in how-migrations-work into a numbered precheck/execute/postcheck list plus a bulleted operation-class list. - Remove em dashes from reference-page prose and headings. All commands, flags, refs, and graph output verified against prisma-next 0.14.x. cspell and lint:links pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Ankur Datta <64993082+ankur-arch@users.noreply.github.com>
1 parent 760ef0a commit 7ed0d25

32 files changed

Lines changed: 208 additions & 109 deletions

apps/docs/content/docs/guides/next/frameworks/elysia.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ In a long-running server, don't call `db.close()` in route handlers; the client'
7979

8080
## Prompt your coding agent
8181

82-
The scaffold installs Prisma Next skills for your coding agent. Prompts that map to this guide:
82+
The scaffold installs [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent. Prompts that map to this guide:
8383

8484
- "Using the prisma-next-queries skill, add GET /users/:id that returns one user or a 404."
8585
- "Add a POST /users route that creates a user from the request body."

apps/docs/content/docs/guides/next/frameworks/hono.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ In a long-running server, don't call `db.close()` in route handlers; the client'
109109

110110
## Prompt your coding agent
111111

112-
The scaffold installs Prisma Next skills for your coding agent. Prompts that map to this guide:
112+
The scaffold installs [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent. Prompts that map to this guide:
113113

114114
- "Using the prisma-next-queries skill, add GET /users/:id that returns one user or a 404."
115115
- "Add a Post model related to User, update the database, and expose GET /users/:id/posts."

apps/docs/content/docs/guides/next/runtimes/bun.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ That is the whole loop: schema to contract, contract to database, typed queries
8585

8686
## Prompt your coding agent
8787

88-
The scaffold installs Prisma Next skills for your coding agent. Prompts that map to this guide:
88+
The scaffold installs [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent. Prompts that map to this guide:
8989

9090
- "Using the prisma-next-queries skill, add a script that lists the 10 newest users."
9191
- "Add a Post model related to User, emit the contract, and update the database."

apps/docs/content/docs/guides/next/runtimes/deno.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Deno reports `Unsupported compiler options in tsconfig.json` for a few options t
8686

8787
## Prompt your coding agent
8888

89-
The scaffold installs Prisma Next skills for your coding agent. Prompts that map to this guide:
89+
The scaffold installs [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent. Prompts that map to this guide:
9090

9191
- "Using the prisma-next-queries skill, add a Deno task that prints every user created in the last day."
9292
- "Tighten the Deno permissions for this project from -A to an explicit allow list."

apps/docs/content/docs/orm/next/contract-authoring/capabilities.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Capabilities record what your database stack supports, so Prisma Ne
44
url: /orm/next/contract-authoring/capabilities
55
metaTitle: Capabilities in Prisma Next
66
metaDescription: How Prisma Next capabilities are derived from the target, adapter, and extension packs, what they gate, and what happens when a required capability is missing.
7+
badge: early-access
78
---
89

910
Not every database stack supports every feature. One setup can run lateral joins, `RETURNING` clauses, and vector distance operations; another cannot.
@@ -86,7 +87,7 @@ Extensions are the main source of capabilities beyond the core; [Using extension
8687

8788
## Prompt your coding agent
8889

89-
Projects scaffolded with `create-prisma` install [Prisma Next skills](/ai/tools/skills) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
90+
Projects scaffolded with `create-prisma@next` install [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
9091

9192
- "Which capabilities does our contract currently require, and which package provides each?"
9293
- "Add pgvector to the project and confirm the capability shows up in the emitted contract."

apps/docs/content/docs/orm/next/contract-authoring/psl-syntax.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Write the Prisma Next contract as a Prisma schema file, using the s
44
url: /orm/next/contract-authoring/psl-syntax
55
metaTitle: Author the Prisma Next contract in PSL
66
metaDescription: Learn how to write a Prisma Next contract in the Prisma schema language, including named types, enums, value objects, relations, and extension types.
7+
badge: early-access
78
---
89

910
PSL is the preferred way to author the Prisma Next [data contract](/orm/next/contract-authoring/the-data-contract). You write a Prisma schema file, usually `prisma/contract.prisma`, and [`prisma-next contract emit`](/cli/next/contract-emit) turns it into `contract.json` and `contract.d.ts`.
@@ -309,7 +310,7 @@ The syntax above declares relations; for which shape to choose and which side ow
309310

310311
## Prompt your coding agent
311312

312-
Projects scaffolded with `create-prisma` install [Prisma Next skills](/ai/tools/skills) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
313+
Projects scaffolded with `create-prisma@next` install [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
313314

314315
- "Using the prisma-next-contract skill, add a Status enum stored as text and use it on the Order model."
315316
- "Add a one-to-many between User and Post with the foreign key on Post."
@@ -318,5 +319,5 @@ Projects scaffolded with `create-prisma` install [Prisma Next skills](/ai/tools/
318319
## Next steps
319320

320321
- Emit and inspect [the artifacts](/orm/next/contract-authoring/the-contract-artifact) the schema produces.
321-
- Prefer defining models in code? See [authoring in TypeScript](/orm/next/contract-authoring/typescript-schema-builder).
322+
- If you prefer defining models in code, see [authoring in TypeScript](/orm/next/contract-authoring/typescript-schema-builder).
322323
- Apply the contract to a database with [`prisma-next db init`](/cli/next/db-init) or plan changes with [`prisma-next migration plan`](/cli/next/migration-plan).

apps/docs/content/docs/orm/next/contract-authoring/the-contract-artifact.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: contract.json and contract.d.ts are the deterministic artifacts eve
44
url: /orm/next/contract-authoring/the-contract-artifact
55
metaTitle: The Prisma Next contract artifacts
66
metaDescription: What contract.json and contract.d.ts contain, how deterministic emission and content hashes work, and how the runtime and tooling consume the artifacts.
7+
badge: early-access
78
---
89

910
Emitting your contract produces two generated files. This page explains what is in each, why they are deterministic, and how their hashes keep your code and your database in agreement.
@@ -104,7 +105,7 @@ An abridged emit of a `User`/`Post` schema:
104105
The sections, top to bottom:
105106

106107
- **`schemaVersion`, `targetFamily`, `target`**: the contract format version and the database this contract targets.
107-
- **`roots`**: the accessor names your queries start from, each mapping to a model. `db.user` exists because `roots.user` points at `User`.
108+
- **`roots`**: the accessor names your queries start from, each mapping to a model. The SQL builder's `db.sql.public.user` exists because `roots.user` points at `User`, and the model it names is what the ORM accessor `db.orm.public.User` hangs off.
108109
- **`domain`**: the application's view. Each field carries `nullable` and a `codecId` such as `pg/text@1`, which names the codec that encodes and decodes values of that type. Relations record cardinality and the fields they join on. The model's `storage` block maps fields to columns.
109110
- **`storage`**: the database's view: tables with columns (native type plus codec), primary keys, uniques, indexes, foreign keys, and value sets backing enums. This is the section migration tooling diffs and `db verify` checks the live schema against.
110111
- **`execution`**: defaults Prisma Next applies before writes, such as UUID generation, kept out of the database's DDL.
@@ -152,7 +153,7 @@ Commit the artifacts alongside the source. They contain structure only, no data
152153

153154
## Prompt your coding agent
154155

155-
Projects scaffolded with `create-prisma` install [Prisma Next skills](/ai/tools/skills) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
156+
Projects scaffolded with `create-prisma@next` install [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
156157

157158
- "Explain the difference between contract.json and contract.d.ts in this project."
158159
- "Re-emit the contract and show me what changed in the artifact."

apps/docs/content/docs/orm/next/contract-authoring/the-data-contract.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: The data contract is the single description of your data model and
44
url: /orm/next/contract-authoring/the-data-contract
55
metaTitle: The Prisma Next data contract
66
metaDescription: What the Prisma Next data contract is, how PSL and TypeScript authoring produce the same artifacts, and how the contract drives typing, migrations, and verification.
7+
badge: early-access
78
---
89

910
Every Prisma Next project has one description of its data: the models, their fields, and how they map to database tables. That description is the data contract.
@@ -92,7 +93,7 @@ It contains no rows, no credentials, and no connection details, so committing th
9293

9394
## Prompt your coding agent
9495

95-
Projects scaffolded with `create-prisma` install [Prisma Next skills](/ai/tools/skills) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
96+
Projects scaffolded with `create-prisma@next` install [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
9697

9798
- "Using the prisma-next-contract skill, explain what our contract.json currently declares."
9899
- "Add an Invoice model to the contract and emit it."

apps/docs/content/docs/orm/next/contract-authoring/typescript-schema-builder.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Define the Prisma Next contract with a typed builder API instead of
44
url: /orm/next/contract-authoring/typescript-schema-builder
55
metaTitle: Author the Prisma Next contract in TypeScript
66
metaDescription: Learn how to define a Prisma Next contract in TypeScript with defineContract, including fields, relations, enums, storage mapping, and extension types.
7+
badge: early-access
78
---
89

910
TypeScript authoring defines the Prisma Next [data contract](/orm/next/contract-authoring/the-data-contract) in code. Instead of a `.prisma` file, you write `prisma/contract.ts` with the `defineContract` builder, and [`prisma-next contract emit`](/cli/next/contract-emit) produces exactly the same `contract.json` and `contract.d.ts` a PSL schema would.
@@ -207,7 +208,7 @@ Post.relations({
207208
});
208209
```
209210

210-
`rel.hasMany(Model, { by })` names the foreign key field on the other model; `rel.belongsTo(Model, { from, to })` maps the local foreign key field to the referenced field. `rel.hasOne` and `rel.manyToMany` cover the remaining shapes. Because the arguments are model objects, not strings, a typo in a relation target is a compile error.
211+
`rel.hasMany(Model, { by })` names the foreign key field on the other model; `rel.belongsTo(Model, { from, to })` maps the local foreign key field to the referenced field. `rel.hasOne` and `rel.manyToMany` cover the remaining shapes. A typo in a relation target is a compile error either way: the PostgreSQL builder takes model objects, and the MongoDB builder takes model names that are type-checked against the declared models.
211212

212213
## Storage mapping
213214

@@ -265,7 +266,7 @@ TypeScript and [PSL](/orm/next/contract-authoring/psl-syntax) authoring emit the
265266

266267
## Prompt your coding agent
267268

268-
Projects scaffolded with `create-prisma` install [Prisma Next skills](/ai/tools/skills) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
269+
Projects scaffolded with `create-prisma@next` install [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent; the `prisma-next-contract` skill covers this page. Ask your agent to:
269270

270271
- "Convert this contract.prisma to the TypeScript schema builder."
271272
- "Using the prisma-next-contract skill, add a unique index to the email field in our TypeScript schema."

apps/docs/content/docs/orm/next/data-modeling/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ In Prisma Next, you define this structure in a `contract.prisma` file. This file
1515

1616
If you are coming from Prisma 7, `contract.prisma` plays a similar role to the `schema.prisma` file you used before.
1717

18-
This page introduces the four building blocks of every Prisma Next schema:
18+
This page introduces the four building blocks of every Prisma Next contract:
1919

2020
- [Models](#models): the things your application works with
2121
- [Primary keys](#primary-keys): how each record is identified
@@ -234,11 +234,11 @@ How each shape is stored, and which model should hold the connecting field, is w
234234

235235
## Prompt your coding agent
236236

237-
Projects scaffolded with `create-prisma` install Prisma Next skills for your coding agent; the `prisma-next-contract` skill covers schema authoring. Prompts that map to each section:
237+
Projects scaffolded with `create-prisma@next` install [Prisma Next skills](/ai/tools/skills#available-skills-for-prisma-next) for your coding agent; the `prisma-next-contract` skill covers contract authoring. Prompts that map to each section:
238238

239239
- "Using the prisma-next-contract skill, add a Product model with a surrogate id and a unique sku field."
240240
- "Add a Country reference table keyed by its ISO code."
241-
- "Review my schema for fields that should be an enum or a DateTime instead of a String."
241+
- "Review my contract for fields that should be an enum or a DateTime instead of a String."
242242
- "Connect Post to User with a foreign key and a relation field."
243243

244244
## Next steps

0 commit comments

Comments
 (0)