Skip to content

docs(next): Prisma Next Fundamentals section (DR-8681)#8011

Open
ankur-arch wants to merge 7 commits into
mainfrom
pn-fundamentals-DR-8681
Open

docs(next): Prisma Next Fundamentals section (DR-8681)#8011
ankur-arch wants to merge 7 commits into
mainfrom
pn-fundamentals-DR-8681

Conversation

@ankur-arch

@ankur-arch ankur-arch commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Adds the Prisma Next Fundamentals section: the ORM happy path for reading, querying, writing, batching, and transacting, plus the advanced-query escape hatches.

Linear: DR-8681 (redirects per DR-8687/DR-8688)

What was added

Five pages in the ORM "Next" version tree under /docs/orm/next/fundamentals (content/docs/orm/next/fundamentals/), following the Concept-and-example template and multi-database rules from the docs spec (prisma-orm-messaging PR #14):

Page Covers
Reading data .all() / .first(), where (object + lambda forms), select, orderBy, take/skip, cursor pagination, counting via .aggregate
Writing data create, update, delete, upsert, and the bulk variants (createAll/updateAll/deleteAll + *Count), single-row vs bulk semantics
Relations and joins .include(...), branch refinement, relation predicates, N:M junction limitation + escape hatch
Transactions db.transaction(...) with commit/rollback, tx.orm/tx.sql/tx.execute; MongoDB driver-session escape hatch
Advanced queries SQL builder (plans, aliased joins, grouped top-N, RETURNING), MongoDB pipeline builder (group, lookup)

Also: sidebar wiring in orm/next/meta.json, Fundamentals cards on the Prisma Next landing page, and prisma-orm-messaging/ added to .gitignore (local working clone of the messaging repo).

How the examples were tested

No untested examples. Two throwaway apps scaffolded with create-prisma@next against @prisma-next 0.14.0:

  • PostgreSQL: temporary database provisioned with bunx create-db; 45+ checks covering every read/filter/bulk/write/transaction/SQL-builder snippet, including rollback-on-throw.
  • MongoDB: mongodb-memory-server (single-node replica set), prisma-next db init against it; 30+ checks including the driver-session transaction escape hatch (commit + abort verified).

Notable tested behaviors the pages document (several diverge from older internal docs):

  • PostgreSQL model access is namespace-qualified: db.orm.public.User (the flat db.orm.User was removed in prisma-next#778); MongoDB stays flat with lowercased plural roots (db.orm.users).
  • .update() / .delete() mutate one matching row; updateAll / deleteAll / *Count are the bulk forms.
  • There is no .count() terminal; counting goes through .aggregate((a) => ({ n: a.count() })) on PostgreSQL and the pipeline builder on MongoDB.
  • MongoDB rows keep raw _id; filters use _id, not the mapped id field.
  • MongoDB facade has no db.transaction(...) and no ORM .aggregate(...); both pages say so directly and show the tested escape hatch.
  • SQL-builder inserts use the array form .insert([{...}]) (single-object form throws in 0.14.0).

Validation: pnpm --filter docs types:check clean, pnpm lint:links 0 errors, dev-server smoke test 200 on all five URLs, tab content confirmed server-rendered (present in the .mdx agent-markdown route).

Redirects: parked as comments until the URL cutover

The DR-8681 redirect map now lives commented out in apps/docs/next.config.mjs under the "Prisma Next URL cutover (DR-8687)" block. These redirects retire live Prisma 7 URLs, so they ship together when /orm/next becomes /orm. Sibling section PRs append their own commented map to the same block (documented in the new docs-writer skill reference). The map, for review:

  • /docs/orm/prisma-client/docs/orm/next/fundamentals/reading-data
  • /docs/orm/prisma-client/queries/crudreading-data (page splits; Writing data cross-linked)
  • /docs/orm/prisma-client/queries/select-fieldsreading-data
  • /docs/orm/prisma-client/queries/filtering-and-sortingreading-data
  • /docs/orm/prisma-client/queries/paginationreading-data
  • /docs/orm/prisma-client/queries/aggregation-grouping-summarizingreading-data
  • /docs/orm/prisma-client/queries/relation-queriesrelations-and-joins
  • /docs/orm/prisma-client/queries/transactionstransactions
  • /docs/orm/prisma-client/using-raw-sqladvanced-queries

Nothing redirects on deploy; enabling the block is the cutover action.

No-equivalent pages, left in place and flagged for the SEO owner (per DR-8681, not silently dropped): queries/full-text-search (extension-based now), queries/advanced/query-optimization-performance (future Guides > Performance), queries/excluding-fields.

Follow-ups filed

  • prisma/prisma-next skills corrections (PR opening next): prisma-next-queries skill still teaches the flat db.orm.User form for Postgres, a .count() terminal, and single-object .insert({...}); none of these match 0.14.0/main behavior.
  • Known upstream issues encountered (not doc contradictions, mentioned for visibility): @default(false) emits an invalid contract in 0.14.0 (fix already on feature/ledger-contract-snapshots); MongoDB @default(now()) is not applied at create time (documented inline); pipeline .match on ObjectId fields matches nothing; create-prisma scaffold templates still use the removed flat ORM form, so the generated db:seed/dev scripts crash on Postgres.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a new “Learn the fundamentals” docs section for Prisma Next with pages covering reading data, writing data, relations and joins, transactions, and advanced queries.
    • Expanded navigation to include the new fundamentals content.
    • Added redirects from older Prisma Client docs routes to the new Prisma Next fundamentals pages.
  • Chores
    • Updated ignore rules to keep an internal directory out of the public repository.

Update (2026-07-06): Fundamentals moved into the ORM "Next" version dropdown (/docs/orm/next/fundamentals/*), the code switcher now uses the app's tab="..." code-block syntax (the <Tabs> JSX rendered broken), and all five pages were rewritten task-first: each section leads with the user task and the simplest example, states return values, and keeps caveats and database-specific notes after the happy path. Redirect destinations updated accordingly.


Update 2 (2026-07-06): first-time-reader revision.

  • Relationship teaching with diagrams. Relations and joins now walks one-to-one, one-to-many, and many-to-many each as concept → diagram → model → query → result shape → pitfalls. The diagrams ship as three new ConceptAnimation flow scenes (same component the Compute docs use), designed from these Mermaid sketches:

    erDiagram
      USER ||--o| PROFILE : "userId (unique)"
      USER ||--o{ POST : "authorId"
      POST ||--o{ POSTTAG : "postId"
      TAG  ||--o{ POSTTAG : "tagId"
    
    Loading
  • Many-to-many is now a working pattern, not a limitation. Testing showed an explicit junction model traverses fine with a nested include (Post.include("tags", (pt) => pt.include("tag")), verified end to end); only the implicit through-relation form is unsupported. Also verified: 1:1 back-reference fields (profile Profile?) are rejected by the PSL provider, so the 1:1 section documents querying from the foreign-key side.

  • Streaming section on Reading data, from a dedicated behavior probe on both databases: await buffers and can be re-awaited (the earlier "second await throws" claim was wrong); any for await makes the result single-use, including after an early break; mixing the two throws AsyncIterableResult iterator has already been consumed.

  • Builder sections restructured into parallel PostgreSQL: SQL query builder / MongoDB: Pipeline builder with when-to-use and when-to-prefer-the-ORM-API guidance and per-use-case tested examples (joins, junction flattening, grouped top-N, RETURNING; $group, staged $match, $lookup).

  • Common mistakes rewritten as narrated subsections (what you meant → what went wrong → fix → why). The type-level claims are verified with @ts-expect-error assertions: .create({ data: {...} }), .update() / .delete() without .where() all fail to compile. Every documented SQL-builder snippet compiles under strict TypeScript.

  • Naming: the product is Prisma Next (not "Prisma Next ORM"); the high-level lane is called the ORM API.


Update 3 (2026-07-06): context and readability pass, emulating the v6 CRUD reference style.

  • Every key query now shows its result shape in a no-copy block, taken from the validation runs.
  • Reading and Writing data open with section-linked intros and an expandable example schema (PostgreSQL/MongoDB tabs).
  • Prisma 7 migration notes are diff blocks: findMany.all(), the data wrapper → direct fields, $transaction([...]) → the callback form.
  • The MongoDB filter section shows how to get ranges and in() through the pipeline builder (newly tested: chained .match gte/lte and .in() both work); the PostgreSQL section gained a tested or() example.
  • Sorting shows the composite orderBy array, and explains why cursor pagination beats offsets before showing it.
  • The streaming section defines what streaming is and when it pays off before the consumption rules.
  • "Choose the right lane" is now "Choose the right query API".
  • Each page ends with Prompt your coding agent: copyable per-section prompts that reference the Prisma Next skills installed by create-prisma (prisma-next-queries, prisma-next-contract).

Update 4 (2026-07-06): redirects moved out of vercel.json into the commented cutover block in next.config.mjs (see above); added .claude/skills/docs-writer/references/prisma-next.md so parallel section PRs follow the same conventions (location, commented redirects, tested examples, tabs, diagrams, naming, validation); documented fns.raw fragments on Advanced queries with a tested example.

…mples (DR-8681)

Adds the five Prisma Next Fundamentals pages (reading data, writing data,
relations and joins, transactions, advanced queries) under
/docs/next/fundamentals, wires them into the sidebar and the Prisma Next
landing page, and adds the temporary Prisma 7 -> Prisma Next redirects
from the DR-8681 table to apps/docs/vercel.json.

Every code sample was validated against @prisma-next 0.14.0: PostgreSQL
via a create-db database, MongoDB via mongodb-memory-server (replica set).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jul 6, 2026 3:23pm
docs Ready Ready Preview, Comment Jul 6, 2026 3:23pm
eclipse Ready Ready Preview, Comment Jul 6, 2026 3:23pm
site Ready Ready Preview, Comment Jul 6, 2026 3:23pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds a new Prisma Next Fundamentals docs section, wires it into navigation and redirects, expands concept animation with relationship flow scenes, and adds a gitignore rule for an internal cloned repo.

Changes

Fundamentals docs addition

Layer / File(s) Summary
Navigation and redirects
apps/docs/content/docs/orm/next/meta.json, apps/docs/content/docs/orm/next/fundamentals/meta.json, apps/docs/content/docs/(index)/next/index.mdx, apps/docs/content/docs/orm/next/index.mdx, apps/docs/vercel.json
Registers the Fundamentals section in docs metadata, adds fundamentals cards to index pages, and redirects legacy ORM routes to the new fundamentals pages.
Reading and writing docs
apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx, apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
Adds pages covering query chaining, filtering, selection, sorting, pagination, counting, streaming, single writes, bulk writes, upserts, and common mistakes.
Relations, transactions, and advanced queries
apps/docs/content/docs/orm/next/fundamentals/relations-and-joins.mdx, apps/docs/content/docs/orm/next/fundamentals/transactions.mdx, apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx
Adds pages covering includes, relation predicates, transaction scope, MongoDB driver sessions, SQL builder plans, and pipeline builder queries.

Concept animation relationship scenes

Layer / File(s) Summary
Relationship flow scenes
apps/docs/src/components/concept-animation/flow-presets.ts
Adds one-to-one, one-to-many, and many-to-many flow scenes and registers them in the scene map.
Animation entry typing
apps/docs/src/components/concept-animation/index.tsx
Widens ConceptAnimation to accept flow scene names and updates scene lookup typing.

Repository ignore rule

Layer / File(s) Summary
Ignore internal clone
.gitignore
Adds an ignore rule for the prisma-orm-messaging/ directory.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • prisma/web#7931: Shares the same ConceptAnimation area and extends the flow preset/component pairing with new scene types.
  • prisma/web#7999: Both PRs update Prisma Next documentation content under apps/docs/content/docs/orm/next/index.mdx and related fundamentals navigation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a Prisma Next Fundamentals section under docs(next).

Comment @coderabbitai help to get the list of available commands.

@argos-ci

argos-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jul 6, 2026, 3:30 PM

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

65 links: ✅ 11 OK | 🚫 0 errors | 🔀 3 redirects | 👻 51 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 11
🔀 Redirected 3
👻 Excluded 51
🚫 Errors 0
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/docs/`(index)/next/fundamentals/reading-data.mdx:
- Around line 82-85: Rename the sample variable in the reading-data docs from
alicesPosts to alicePosts to avoid the awkward possessive form and the cspell
hit; update the identifier in the posts query example so it consistently uses
alicePosts in that snippet.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a1d87228-ecf8-4084-9191-c9b74a956d1c

📥 Commits

Reviewing files that changed from the base of the PR and between d406817 and e2b2984.

📒 Files selected for processing (10)
  • .gitignore
  • apps/docs/content/docs/(index)/meta.json
  • apps/docs/content/docs/(index)/next/fundamentals/advanced-queries.mdx
  • apps/docs/content/docs/(index)/next/fundamentals/meta.json
  • apps/docs/content/docs/(index)/next/fundamentals/reading-data.mdx
  • apps/docs/content/docs/(index)/next/fundamentals/relations-and-joins.mdx
  • apps/docs/content/docs/(index)/next/fundamentals/transactions.mdx
  • apps/docs/content/docs/(index)/next/fundamentals/writing-data.mdx
  • apps/docs/content/docs/(index)/next/index.mdx
  • apps/docs/vercel.json

Comment thread apps/docs/content/docs/(index)/next/fundamentals/reading-data.mdx Outdated
… task-first

- Move the five Fundamentals pages from /docs/next/fundamentals to
  /docs/orm/next/fundamentals so they live in the ORM "Next" version
  dropdown, and register the section in orm/next/meta.json.
- Replace the broken <Tabs> JSX with the app's code-tab syntax
  (```lang tab="PostgreSQL"), which renders the styled code switcher.
- Rewrite all pages task-first: each section starts with what to do and
  which API to use, shows the simplest example, states what it returns,
  and keeps caveats after the happy path. Implementation details
  (adapter capabilities, planner internals) removed from Fundamentals;
  limitations rephrased as user-facing guidance. Count-returning
  examples use count-named variables.
- Update redirect destinations in vercel.json and landing-page cards to
  the new /docs/orm/next/fundamentals URLs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx (1)

72-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a code example for or/and/not helpers.

Every other filtering capability in this section (equality, lambda comparisons, range) has a code sample; this one is described in prose only. A short snippet would make the OR/NOT pattern immediately usable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx` at line 72,
The OR/NOT filtering guidance in the reading-data section is only described in
prose; add a short example showing how to use the `or`, `and`, and `not` helpers
from `@prisma-next/sql-orm-client` alongside the surrounding query-building
examples. Place the snippet near the existing filtering samples in the docs so
readers can see the pattern immediately and reuse it with the same style as the
other helpers in this section.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx`:
- Line 72: The OR/NOT filtering guidance in the reading-data section is only
described in prose; add a short example showing how to use the `or`, `and`, and
`not` helpers from `@prisma-next/sql-orm-client` alongside the surrounding
query-building examples. Place the snippet near the existing filtering samples
in the docs so readers can see the pattern immediately and reuse it with the
same style as the other helpers in this section.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 627b6025-6a1d-4a7a-a3f8-c58b1387851d

📥 Commits

Reviewing files that changed from the base of the PR and between e2b2984 and 101699f.

📒 Files selected for processing (10)
  • apps/docs/content/docs/(index)/next/index.mdx
  • apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx
  • apps/docs/content/docs/orm/next/fundamentals/meta.json
  • apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx
  • apps/docs/content/docs/orm/next/fundamentals/relations-and-joins.mdx
  • apps/docs/content/docs/orm/next/fundamentals/transactions.mdx
  • apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
  • apps/docs/content/docs/orm/next/index.mdx
  • apps/docs/content/docs/orm/next/meta.json
  • apps/docs/vercel.json
💤 Files with no reviewable changes (1)
  • apps/docs/content/docs/orm/next/fundamentals/meta.json
✅ Files skipped from review due to trivial changes (7)
  • apps/docs/content/docs/orm/next/meta.json
  • apps/docs/content/docs/orm/next/index.mdx
  • apps/docs/content/docs/orm/next/fundamentals/relations-and-joins.mdx
  • apps/docs/content/docs/(index)/next/index.mdx
  • apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx
  • apps/docs/content/docs/orm/next/fundamentals/transactions.mdx
  • apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/vercel.json

…ture builders

Deep revision of the Fundamentals pages for first-time readers:

- Relations and joins now teaches one-to-one, one-to-many, and
  many-to-many each as concept -> animated diagram -> model -> query ->
  result shape -> pitfalls, using three new ConceptAnimation flow scenes.
  Many-to-many is documented as a working pattern (explicit junction
  model + nested include, verified end to end) instead of a limitation.
- Reading data gains a tested "Stream large results" section: await
  buffers and is reusable, for-await streams and is single-use, mixing
  the two throws. (Verified on both databases; a repeated await does
  NOT throw, correcting the earlier claim.)
- Advanced queries restructured into parallel "PostgreSQL: SQL query
  builder" and "MongoDB: Pipeline builder" sections, each with
  what-it-is, when to use it, when to prefer the ORM API, and tested
  examples per use case.
- Common mistakes rewritten as narrated subsections: what you meant,
  what went wrong, the fix, and why it is safer. Type-level claims
  (no data wrapper, mutations require .where) verified with
  @ts-expect-error assertions; all documented snippets compile under
  strict TypeScript.
- Naming: "Prisma Next ORM" replaced with Prisma Next; the query lane
  is called the ORM API.

Test schema extended with Profile (1:1) and Tag/PostTag (M:N junction);
1:1 back-reference fields are unsupported by the PSL provider, so the
1:1 section documents querying from the foreign-key side.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx (2)

203-210: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

"Reusing a streamed result" mistake example doesn't show the mistake.

The other two "Common mistakes" entries on this page show the wrong code, then the fix. This one jumps straight to the corrected await ... .all() pattern without showing the actual mistake (re-iterating or re-awaiting a for await result), which is already demonstrated earlier at Line 160-169. Consider pairing the mistake snippet with the fix here for consistency, e.g.:

📝 Suggested addition
 ### Reusing a streamed result

 You streamed a result with `for await`, then tried to read it again. The second read throws, because a streamed result is consumed as it is read. Store the data if you need it twice:

+```typescript
+for await (const post of db.orm.public.Post.all()) {
+  // ...
+}
+// Re-reading the same result throws here.
+```
+
 ```typescript
 const posts = await db.orm.public.Post.all();
 // posts is a plain array now; read it as often as you like
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx around lines
203 - 210, The “Reusing a streamed result” example in reading-data.mdx skips the
actual mistake and jumps straight to the fix, unlike the other Common mistakes
entries. Update the section around the “Reusing a streamed result” heading to
show the wrong pattern first using the streamed result from
db.orm.public.Post.all() with for await, then follow it with the corrected
“store the data” example using await ... .all(), matching the style used in the
other mistake examples on the page.


</details>

<!-- cr-comment:v1:4466e2708c27d3a1341b2a96 -->

---

`72-75`: _📐 Maintainability & Code Quality_ | _🔵 Trivial_ | _⚡ Quick win_

**Add a short OR/AND/NOT example** The surrounding filter sections are example-driven, but this paragraph only describes the helper APIs in prose. A tiny PostgreSQL snippet showing the `@prisma-next/sql-orm-client` import plus `or(...)`, `and(...)`, and `not(...)` usage would make the call shape obvious.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx around lines
72 - 75, Add a brief PostgreSQL example in the reading-data docs where the
helper APIs are introduced, using the existing or, and, and not symbols
from @prisma-next/sql-orm-client so readers can see the call shape directly.
Keep the MongoDB note as-is, but make the new snippet concise and aligned with
the surrounding filter examples to show how the boolean helpers are combined in
a .where(...) query.


</details>

<!-- cr-comment:v1:fda6c19beeba9e213b961ef1 -->

</blockquote></details>
<details>
<summary>apps/docs/src/components/concept-animation/index.tsx (1)</summary><blockquote>

`15-19`: _📐 Maintainability & Code Quality_ | _🔵 Trivial_ | _💤 Low value_

**Optional: simplify indexed-type casts.**

`(typeof FLOW_SCENES)[FlowName]` resolves to just `FlowScene` (all values share that type), and `(typeof CONCEPT_PRESETS)[ConceptName]` resolves to the preset's value type. Importing those types directly would read more clearly than the indexed-access expressions.




<details>
<summary>♻️ Optional simplification</summary>

```diff
-import { FLOW_SCENES, type FlowName } from "./flow-presets";
+import { FLOW_SCENES, type FlowName, type FlowScene } from "./flow-presets";
...
-  const scene = (FLOW_SCENES as Partial<Record<string, (typeof FLOW_SCENES)[FlowName]>>)[name];
+  const scene = (FLOW_SCENES as Partial<Record<string, FlowScene>>)[name];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/src/components/concept-animation/index.tsx` around lines 15 - 19,
Simplify the indexed-type casts in ConceptAnimation by replacing the inline
`(typeof FLOW_SCENES)[FlowName]` and `(typeof CONCEPT_PRESETS)[ConceptName]`
usages with the actual imported value types. Update the `ConceptAnimation`
function’s `scene` and `preset` lookups to use those explicit types instead of
the indexed-access expressions, keeping the existing runtime logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx`:
- Around line 203-210: The “Reusing a streamed result” example in
reading-data.mdx skips the actual mistake and jumps straight to the fix, unlike
the other Common mistakes entries. Update the section around the “Reusing a
streamed result” heading to show the wrong pattern first using the streamed
result from db.orm.public.Post.all() with for await, then follow it with the
corrected “store the data” example using await ... .all(), matching the style
used in the other mistake examples on the page.
- Around line 72-75: Add a brief PostgreSQL example in the reading-data docs
where the helper APIs are introduced, using the existing `or`, `and`, and `not`
symbols from `@prisma-next/sql-orm-client` so readers can see the call shape
directly. Keep the MongoDB note as-is, but make the new snippet concise and
aligned with the surrounding filter examples to show how the boolean helpers are
combined in a `.where(...)` query.

In `@apps/docs/src/components/concept-animation/index.tsx`:
- Around line 15-19: Simplify the indexed-type casts in ConceptAnimation by
replacing the inline `(typeof FLOW_SCENES)[FlowName]` and `(typeof
CONCEPT_PRESETS)[ConceptName]` usages with the actual imported value types.
Update the `ConceptAnimation` function’s `scene` and `preset` lookups to use
those explicit types instead of the indexed-access expressions, keeping the
existing runtime logic unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2c9a400a-b9d8-4ede-8f48-6aea5a41215e

📥 Commits

Reviewing files that changed from the base of the PR and between 101699f and 6d29d03.

📒 Files selected for processing (7)
  • apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx
  • apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx
  • apps/docs/content/docs/orm/next/fundamentals/relations-and-joins.mdx
  • apps/docs/content/docs/orm/next/fundamentals/transactions.mdx
  • apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
  • apps/docs/src/components/concept-animation/flow-presets.ts
  • apps/docs/src/components/concept-animation/index.tsx
✅ Files skipped from review due to trivial changes (3)
  • apps/docs/content/docs/orm/next/fundamentals/relations-and-joins.mdx
  • apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
  • apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx

…tals

Style pass emulating the v6 CRUD reference:

- Section-linked page intros and an expandable example schema
  (PostgreSQL/MongoDB tabs) on Reading and Writing data.
- Queries now show their result shape in no-copy blocks, taken from
  the validation runs.
- Prisma 7 migration notes are diff blocks (findMany -> .all(),
  data wrapper -> direct fields, $transaction array -> callback).
- MongoDB filter section shows how to reach ranges and in() through
  the pipeline builder (newly tested: .match gte/lte chaining and
  .in() both work); PostgreSQL filters gain or() example (tested).
- Sort section shows the composite orderBy array and explains offset
  vs cursor pagination before the cursor example.
- Streaming section now defines streaming and its benefits before the
  consumption rules.
- "Choose the right lane" renamed to "Choose the right query API".
- Each page ends with "Prompt your coding agent": copyable prompts
  per section that reference the scaffolded Prisma Next skills.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx`:
- Around line 230-252: The pagination example in the reading-data docs is
missing the tiebreaker used by the composite sort above, so it can produce
unstable results when createdAt is not unique. Update the cursor pagination
example to match the orderBy composition in the Post example, using the same
sort keys in the cursor resume step, or add a brief note in the docs explaining
that a unique tiebreaker like id must be included for correctness on tied
timestamps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b94e86d-f0da-4e02-a08b-9ebde624b535

📥 Commits

Reviewing files that changed from the base of the PR and between 6d29d03 and 90a65d3.

📒 Files selected for processing (5)
  • apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx
  • apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx
  • apps/docs/content/docs/orm/next/fundamentals/relations-and-joins.mdx
  • apps/docs/content/docs/orm/next/fundamentals/transactions.mdx
  • apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
✅ Files skipped from review due to trivial changes (3)
  • apps/docs/content/docs/orm/next/fundamentals/advanced-queries.mdx
  • apps/docs/content/docs/orm/next/fundamentals/writing-data.mdx
  • apps/docs/content/docs/orm/next/fundamentals/transactions.mdx

Comment thread apps/docs/content/docs/orm/next/fundamentals/reading-data.mdx
…dance

- Cursor pagination example now carries the id tiebreaker in both the
  composite orderBy and the cursor, with a sentence on why a cursor on
  a non-unique field alone can skip or repeat records. Verified against
  rows sharing the same createdAt: pages come back with zero overlap.
- .select(...).create(...) now has a tested example with its narrowed
  result shape, and the same show-don't-tell treatment applies to the
  primary-key lookup (tabs), the updateAll rows result, and the 1:1
  user-side SQL builder join that was previously only linked.
- Result-block ids replaced with format-preserving placeholders so
  cspell passes (the random cuid/ObjectId fragments tripped it).

The alicesPosts naming flag was already resolved by an earlier rewrite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…entions

- Remove the nine live Prisma 7 -> Prisma Next redirects from
  apps/docs/vercel.json and park them, commented out, in
  next.config.mjs under a "Prisma Next URL cutover (DR-8687)" block.
  They ship when /orm/next becomes /orm; until then section owners
  append their commented map to the same block so the full cutover
  builds up in one reviewable place.
- Add .claude/skills/docs-writer/references/prisma-next.md so the
  parallel section PRs follow the same conventions: page location,
  the commented-redirects rule, tested-example requirements, tab and
  diagram usage, naming, and validation commands. Linked from SKILL.md.
- Document raw SQL precisely on Advanced queries: standalone raw
  statements do not run, but fns.raw fragments inside the SQL query
  builder do (tested with a computed UPPER(email) projection).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ankur-arch

Copy link
Copy Markdown
Contributor Author

Re-validated every example against a fresh Prisma Postgres database (bunx create-db) and a local MongoDB replica set (mongodb-memory-server), 2026-07-07. PostgreSQL: 45/45 core checks, 15/15 relations/streaming, 6/6 builder checks, plus the consumption probes (await twice OK, any for-await makes the result single-use), composite cursor with zero page overlap on tied timestamps, or()/fns.raw/junction-create checks. MongoDB: 26/26 core checks, snippet shapes, driver-session transaction escape hatch (commit and abort), streaming parity, and pipeline range/in() probes. The three legacy suite checks that exercised superseded API shapes were updated to the documented forms, so the suites now run green end to end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant