Skip to content

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Jan 7, 2026

Summary by CodeRabbit

  • Documentation
    • Clarified how TypeScript enums are generated from schema definitions in Prisma ORM.
    • Updated Prisma 7 upgrade guide with clarifications on enum value behavior and database-level mapping.
    • Added guidance on adapter version pinning for better-sqlite3 compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

Walkthrough

These changes clarify that Prisma 7's mapped enum behavior has reverted to Prisma 6 semantics: TypeScript enums use schema names rather than mapped database values, with database-level mapping remaining intact. Documentation is updated across the core schema mapping reference and the v7 upgrade guide to reflect this behavior consistently.

Changes

Cohort / File(s) Summary
Mapped Enum Behavior Clarification
content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx
Updates heading and narrative to clarify that generated TypeScript enums use schema names (not @map values), with mapping handled exclusively at the database level. Example output changed to reflect schema-name-based enum generation.
Prisma 7 Upgrade Guide
content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx
Replaces migration workarounds with "reverted behavior" note explaining that mapped enum handling reverts to v6 semantics. Adds adapter-pinning documentation for @prisma/adapter-better-sqlite3 v12.4.1, removes breaking-change framing, and clarifies no migration is required.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title references internal ticket numbers (TML-1663, TML-1760) without conveying what changes were actually made to the documentation. Replace ticket references with a clear summary of the primary change, such as 'Docs: Update enum mapping behavior for Prisma v7' or similar descriptive text.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx (1)

402-426: Section heading inconsistency: "Before Prisma ORM v6" vs "In v6"

There's a mismatch between the heading at line 402 ("Before Prisma ORM v6") and the explanatory text at line 414 ("In v6, the generated TypeScript enum was:"). The heading implies v5 and earlier, but the content actually describes v6 behavior.

Since the narrative is about the reversion to v6 semantics, consider renaming the heading to clarify:

📝 Suggested fix
-#### Before Prisma ORM v6
+#### Prisma ORM v6 (and now v7)

Or alternatively, if you want to keep a "before/after" structure showing what was planned:

-#### Before Prisma ORM v6
+#### Prisma ORM v6 behavior
🧹 Nitpick comments (1)
content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx (1)

223-239: Consider adding npm overrides syntax alongside pnpm.

The override example only shows the pnpm syntax. For npm users, the syntax is slightly different and lives at the top level of package.json:

📝 Suggested addition for npm users
 ```json
 {
+  // For npm:
+  "overrides": {
+    "better-sqlite3": "9.6.0"
+  },
+  // For pnpm:
   "pnpm": {
     "overrides": {
       "better-sqlite3": "9.6.0"
     }
   }
 }

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: Path: .coderabbit.yaml

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 500e4726e2c8eace9e7d0e384d2e1f620ba93bd5 and 69819bfe1db067445a0dc6e0320631db5d517b51.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx`
* `content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx`

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (1)</summary>

<details>
<summary>📚 Learning: 2026-01-06T22:06:57.725Z</summary>

Learnt from: newclarityex
Repo: prisma/docs PR: 7425
File: content/200-orm/050-overview/500-databases/400-mysql.mdx:80-80
Timestamp: 2026-01-06T22:06:57.725Z
Learning: In Prisma docs, when showing examples of instantiating driver adapters with connection strings from environment variables, use the template literal pattern const connectionString = ${process.env.DATABASE_URL}`` for consistency across all database adapter examples (PostgreSQL, MySQL/MariaDB, etc.).


**Applied to files:**
- `content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx`
- `content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx`

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)</summary>

* GitHub Check: Check internal links
* GitHub Check: Cloudflare Pages

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>content/200-orm/100-prisma-schema/20-data-model/50-database-mapping.mdx (1)</summary><blockquote>

`81-101`: **Documentation updates look accurate and well-aligned with the reverted behavior.**

The changes correctly reflect that:
1. TypeScript enums use schema names (`PENDING`, `APPROVED`) rather than mapped database values
2. The `@map` directive only affects the database layer

The example is clear, and removing the version-specific qualifier from the heading is appropriate since this behavior now applies consistently. This aligns well with the corresponding upgrade guide changes.

</blockquote></details>
<details>
<summary>content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx (1)</summary><blockquote>

`394-400`: **Clear communication of the reverted behavior.**

The note block explaining the reversion is helpful, and the migration steps section correctly informs users that no action is needed. This should reduce confusion for developers upgrading from v6 who might have been expecting breaking changes in enum handling.

The statement "The mapping is handled at the database level only" is consistent with the database-mapping.mdx file, maintaining good documentation coherence across the docs.




Also applies to: 436-440

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@cloudflare-workers-and-pages
Copy link

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 69819bf
Status: ✅  Deploy successful!
Preview URL: https://36247201.docs-51g.pages.dev
Branch Preview URL: https://dr-6723-docs-for-tml-1663-an.docs-51g.pages.dev

View logs

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.

2 participants