Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
WalkthroughDocs across multiple Prisma ORM pages updated for v6.15.0 to document GA support for running without Rust engines. Generator examples now include explicit Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Schema as Prisma schema
participant CLI as npx prisma generate
participant Adapter as Driver adapter (installed package)
participant App as Application runtime
participant DB as Database
Dev->>Schema: add generator { provider, output, engineType="client" }
Dev->>CLI: run npx prisma generate
CLI->>Schema: generate Prisma Client (split files at output)
Dev->>Adapter: install appropriate adapter for DB
App->>Adapter: instantiate Prisma Client with adapter
App->>DB: execute queries via adapter (no Rust engine)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🪛 LanguageToolcontent/250-postgres/100-introduction/230-management-api.mdx[grammar] ~69-~69: There might be a mistake here. (QB_NEW_EN) [grammar] ~70-~70: There might be a mistake here. (QB_NEW_EN) ⏰ 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). (3)
🔇 Additional comments (2)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
There was a problem hiding this comment.
Actionable comments posted: 6
🔭 Outside diff range comments (1)
content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx (1)
15-35: Align “Use Prisma ORM without Rust binaries” tip to v6.15.0 engineType flowThe current tip (lines 15–35) still shows the old
previewFeatures = ["queryCompiler", "driverAdapters"]approach, which conflicts with the engine-based flow promoted later in this file (lines 77–80). Replace it with the engineType snippet introduced in v6.15.0:• File: content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx
• Replace lines 15–35 with::::tip Use Prisma ORM without Rust binaries As of [v6.15.0](https://pris.ly/release/6.15.0), you can generate Prisma Client without any Rust engines by opting into the client-only engine: ```prisma generator client { provider = "prisma-client-js" // or "prisma-client" engineType = "client" output = "./generated/client" }Note that driver adapters are still required in this setup.
Learn more in the no-rust-engine docs and check out our blog post on Prisma ORM without Rust.
:::</blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (16)</summary><blockquote> <details> <summary>content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx (2)</summary><blockquote> `77-79`: **Fix typo and unmatched quotes/backticks in inline code.** The bullet has a misspelling and an unmatched quote/backtick in the inline code for engineType. Apply this diff: ```diff -The usage of this plugin becomes obsolet if: -- you are using [Prisma ORM without Rust engines](/orm/prisma-client/setup-and-configuration/no-rust-engine) (via `engineType = "client` on your `generator` block) +The usage of this plugin becomes obsolete if: +- you are using [Prisma ORM without Rust engines](/orm/prisma-client/setup-and-configuration/no-rust-engine) (via `engineType = "client"` on your `generator` block)
83-83: Typo: “additonally” → “additionally”.Small spelling fix to improve readability.
-In a more sophisticated CI/CD environment, you may additonally want to update +In a more sophisticated CI/CD environment, you may additionally want to updatecontent/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx (1)
17-32: Good addition; consider adding a one-line install hint for driver adapters.The snippet and notes are consistent with the v6.15.0 “no Rust engines” guidance. To make adoption smoother, add a short note showing which adapter package to install for common databases (e.g.,
@prisma/adapter-pg).Example sentence to add after Line 29:
- For PostgreSQL, install
@prisma/adapter-pgand use it to initialize Prisma Client.content/200-orm/200-prisma-client/500-deployment/650-caveats-when-deploying-to-aws-platforms.mdx (2)
69-85: LGTM; clarify applicability of the subsequent cleanup section.The no-Rust guidance and generator snippet look good. Consider adding a short sentence noting that the “Deleting Prisma ORM engines that are not required” section applies only when using Rust engines, to avoid confusing readers who opted into
engineType = "client".
62-62: Grammar: “an deployment package upload limit” → “a deployment package upload limit”.Minor grammatical correction.
-AWS Lambda defines an **deployment package upload limit**, which includes: +AWS Lambda defines a **deployment package upload limit**, which includes:content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (2)
48-66: Solid update; consider an explicit pointer for readers about scope of “Binary targets” below.The note and snippet correctly show
engineType = "client"and mention driver adapters. To reduce potential confusion when readers continue to the “Binary targets” content, add a one-liner that the remainder of the section applies to Rust-engine usage only.Example sentence to append just before Line 69:
- The following “Binary targets” guidance applies when using Rust engines (i.e., not using
engineType = "client").
149-159: Potential inconsistency with no-Rust flow: “including the query engine binary”.This part states that the generated output includes the query engine binary. That’s true for Rust engines but not when using
engineType = "client". Consider conditioning this statement or adding a note so readers don’t get mixed signals.content/200-orm/800-more/100-under-the-hood/100-engines.mdx (1)
13-14: Scope the statement about generated paths to cover the no-Rust flow.“All of these components are located in the generated
.prisma/clientfolder” is accurate forprisma-client-jswith Rust engines. When usingengineType = "client"or theprisma-clientgenerator, assets live in the configuredoutputpath. Add a short qualifier to avoid confusion.content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx (1)
270-286: Clarify adapter-mode pooling and standardize generator example
- Consider explicitly stating that when using driver adapters (engineType = "client"), the Prisma datasource URL’s connection_limit parameter is ignored; pooling is configured in the underlying JS driver.
- The generator example’s output path ("../src/generated/prisma") is inconsistent with other pages in this PR that use "../generated/prisma". Please standardize.
Proposed edits:
As of [v6.15.0](https://pris.ly/release/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). **When enabled, your Prisma Client will be generated without a Rust-based query engine binary**: ```prisma generator client { - provider = "prisma-client-js" // or "prisma-client" - output = "../src/generated/prisma" - engineType = "client" // no Rust engine + provider = "prisma-client-js" // or "prisma-client" + output = "../generated/prisma" + engineType = "client" // no Rust engine }-Note that driver adapters are required if you want to use Prisma ORM without Rust engines. In this scenario, the connection pool size is set via the native JS driver you are using.
+Note that driver adapters are required if you want to use Prisma ORM without Rust engines. In this scenario:
+- The Prismaconnection_limitparameter in the datasource URL is ignored.
+- Configure pooling via the native JS driver you are using.You can read about the performance and DX improvements of this change on our blog.
</blockquote></details> <details> <summary>content/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdx (1)</summary><blockquote> `12-27`: **Avoid mixed guidance: call out that the rest of the page applies only when using Rust engines** The note correctly introduces engineType = "client", but the rest of the page proceeds to discuss Rust engine binaries and binaryTargets. Add an explicit statement that if engineType = "client" is used, readers can skip the remaining sections. Also standardize the generator output path. Proposed edits: ```diff As of [v6.15.0](https://pris.ly/release/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). **When enabled, your Prisma Client will be generated without a Rust-based query engine binary**: ```prisma generator client { - provider = "prisma-client-js" // or "prisma-client" - output = "../src/generated/prisma" - engineType = "client" // no Rust engine + provider = "prisma-client-js" // or "prisma-client" + output = "../generated/prisma" + engineType = "client" // no Rust engine }-Note that driver adapters are required if you want to use Prisma ORM without Rust engines.
+Note that driver adapters are required if you want to use Prisma ORM without Rust engines.
+If you useengineType = "client", you do not need to configurebinaryTargetsor ship Rust-based engine binaries — the remainder of this page applies only when using Rust engines.You can read about the performance and DX improvements of this change on our blog.
</blockquote></details> <details> <summary>content/200-orm/200-prisma-client/500-deployment/400-module-bundlers.mdx (1)</summary><blockquote> `15-31`: **Explicitly state that copying the query engine binary is unnecessary with engineType = "client"** This page primarily explains copying Rust engine binaries into bundles. Add a sentence making it clear that if engineType = "client" is used, the binary copying steps are not needed. Also consider aligning the generator example output path with the rest of the docs. Proposed edits: ```diff As of [v6.15.0](https://pris.ly/release/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). **When enabled, your Prisma Client will be generated without a Rust-based query engine binary**: ```prisma generator client { - provider = "prisma-client-js" // or "prisma-client" - output = "../src/generated/prisma" - engineType = "client" // no Rust engine + provider = "prisma-client-js" // or "prisma-client" + output = "../generated/prisma" + engineType = "client" // no Rust engine }-Note that driver adapters are required if you want to use Prisma ORM without Rust engines.
+Note that driver adapters are required if you want to use Prisma ORM without Rust engines.
+If you useengineType = "client", you do not need to copy any Rust engine binary with your bundle — the rest of this page applies to Rust-engine setups only.You can read about the performance and DX improvements of this change on our blog.
</blockquote></details> <details> <summary>content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx (5)</summary><blockquote> `15-17`: **Fix grammar: duplicate phrase “on the”** There’s a duplicated “on the” in the bullet list. Proposed edit: ```diff -- `engineType = "client"` field needs to be set on the on the `generator` block +- `engineType = "client"` field needs to be set on the `generator` block
28-34: Consider removing or standardizing the custom output path in the generator blockThis guide uses
output = "../generated/prisma", while several other pages use../src/generated/prisma. Either standardize on one path across the PR or removeoutputentirely to avoid path/import confusion.If you keep the custom output here, ensure all code samples in this page import from
./generated/prisma.
36-43: Fix grammar: “you need re-generate” → “you need to re-generate”Proposed edit:
-To make the configuration take effect, you need re-generate Prisma Client: +To make the configuration take effect, you need to re-generate Prisma Client:
84-89: Typo: “Neon Serverles” → “Neon Serverless”Also check for this typo elsewhere in the repo (appears again in the Preview section in other files).
Proposed edit:
-<TabItem value="Neon Serverles"> +<TabItem value="Neon Serverless">
210-214: Minor style: consider adding a quick note about DATABASE_URLOptional: Add a short reminder that DATABASE_URL must be set (e.g., via
.env) for the adapter examples to work, especially for newcomers switching from Rust engines.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (10)
content/200-orm/050-overview/500-databases/200-database-drivers.mdx(1 hunks)content/200-orm/100-prisma-schema/10-overview/03-generators.mdx(1 hunks)content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx(1 hunks)content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdx(1 hunks)content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx(2 hunks)content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx(1 hunks)content/200-orm/200-prisma-client/500-deployment/400-module-bundlers.mdx(1 hunks)content/200-orm/200-prisma-client/500-deployment/650-caveats-when-deploying-to-aws-platforms.mdx(1 hunks)content/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdx(1 hunks)content/200-orm/800-more/100-under-the-hood/100-engines.mdx(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ankur-arch
PR: prisma/docs#7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.
📚 Learning: 2025-08-11T09:40:55.237Z
Learnt from: ankur-arch
PR: prisma/docs#7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.
Applied to files:
content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/index.mdxcontent/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdxcontent/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdxcontent/200-orm/200-prisma-client/500-deployment/650-caveats-when-deploying-to-aws-platforms.mdxcontent/200-orm/800-more/100-under-the-hood/100-engines.mdxcontent/200-orm/100-prisma-schema/10-overview/03-generators.mdxcontent/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdxcontent/200-orm/050-overview/500-databases/200-database-drivers.mdxcontent/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdxcontent/200-orm/200-prisma-client/500-deployment/400-module-bundlers.mdx
🪛 LanguageTool
content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx
[grammar] ~15-~15: There might be a mistake here.
Context: ... "client"field needs to be set on the on thegeneratorblock - nobinaryTargets` ...
(QB_NEW_EN)
[grammar] ~101-~101: There might be a mistake here.
Context: ...ctionString: process.env.DATABASE_URL }) const prisma = new PrismaClient({ adapte...
(QB_NEW_EN)
[grammar] ~119-~119: There might be a mistake here.
Context: ...isma/adapter-d1' export interface Env { DB: D1Database } export default { asy...
(QB_NEW_EN)
[grammar] ~156-~156: There might be a mistake here.
Context: ....env.DATABASE_URL, fetch: undiciFetch }) const prisma = new PrismaClient({ adapte...
(QB_NEW_EN)
[grammar] ~190-~190: There might be a mistake here.
Context: ...ctionString: process.env.DATABASE_URL }) const prisma = new PrismaClient({ adapte...
(QB_NEW_EN)
⏰ 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). (3)
- GitHub Check: runner / linkspector
- GitHub Check: Check internal links
- GitHub Check: Lost Pixel
| As of [v6.15.0](https://pris.ly/release/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). | ||
|
|
||
| **When enabled, your Prisma Client will be generated [without a Rust-based query engine binary](/orm/prisma-client/setup-and-configuration/no-rust-engine)**: | ||
| **When enabled, your Prisma Client will be generated without a Rust-based query engine binary**: | ||
|
|
||
| ```prisma | ||
| generator client { | ||
| provider = "prisma-client-js" | ||
| previewFeatures = ["queryCompiler", "driverAdapters"] | ||
| provider = "prisma-client-js" // or "prisma-client" | ||
| output = "../src/generated/prisma" | ||
| engineType = "client" // no Rust engine | ||
| } | ||
| ``` | ||
|
|
||
| > Note that the [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) Preview feature is required alongside `queryCompiler`. | ||
| Note that [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) are required if you want to use Prisma ORM without Rust engines. | ||
|
|
||
| You can [read about the performance and DX improvements](https://www.prisma.io/blog/prisma-orm-without-rust-latest-performance-benchmarks) of this change on our blog. | ||
|
|
||
| ::: |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Great addition, plus two follow-ups: output path consistency and preview references later in this doc
- The GA note and generator example look good. Please standardize the output path across the PR (here it’s
../src/generated/prismawhile the main no-Rust-engine guide uses../generated/prisma). - This page still contains “How to use driver adapters” instructions referencing
previewFeatures = ["driverAdapters"](later in the file). That contradicts the GA note above. Update that section to the GA flow (setengineType = "client", generate, install adapter, instantiate).
To locate outdated preview references in this file:
Also verify “preview” anchors in the Serverless adapters section are still valid:
🏁 Script executed:
#!/bin/bash
rg -n -C2 -P 'previewFeatures\s*=\s*\[.*driverAdapters.*\]' content/200-orm/050-overview/500-databases/200-database-drivers.mdxLength of output: 267
🏁 Script executed:
#!/bin/bash
rg -n -C2 -P 'how-to-use-.*-with-prisma-orm-preview' content/200-orm/050-overview/500-databases/200-database-drivers.mdxLength of output: 1069
Standardize output path & migrate driver adapters section to GA flow
-
Replace the generator example’s output path to match the main no-Rust-engine guide. In content/200-orm/050-overview/500-databases/200-database-drivers.mdx, change:
generator client { provider = "prisma-client-js" -
output = "../src/generated/prisma"
- output = "../generated/prisma"
engineType = "client"
}
- Remove the old `previewFeatures = ["driverAdapters"]` snippet (lines 85–88) and update that block to the GA flow. It should look like:
```prisma
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
engineType = "client"
}
Then follow with “install your adapter and instantiate Prisma Client” steps, rather than the previewFeatures instructions.
- Update all serverless adapter links (around lines 69–71 and 100–101) to point at the GA anchors—remove the
-previewsuffix. For example:- Neon →
/orm/overview/databases/neon#how-to-use-neons-serverless-driver-with-prisma-orm - PlanetScale →
/orm/overview/databases/planetscale#how-to-use-the-planetscale-serverless-driver-with-prisma-orm
- Neon →
🤖 Prompt for AI Agents
In content/200-orm/050-overview/500-databases/200-database-drivers.mdx around
lines 15-101, standardize the generator output path, remove the old
previewFeatures snippet, migrate to the GA driver-adapters flow, and update
serverless adapter links: change the generator.example output from
"../src/generated/prisma" to "../generated/prisma"; remove the previewFeatures =
["driverAdapters"] block (lines ~85–88) and replace it with the GA instructions
— a generator block using engineType = "client" and then the steps to install
your adapter and instantiate Prisma Client; and update the serverless adapter
links at the two places around lines ~69–71 and ~100–101 to remove the
"-preview" suffix so Neon and PlanetScale links point to their GA anchors.
| <TabItem value="PostgreSQL"> | ||
| ```typescript | ||
| import { PrismaPg } from '@prisma/adapter-pg' | ||
| import { PrismaClient } from './generated/prisma' | ||
|
|
||
| const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }) | ||
| const prisma = new PrismaClient({ adapter }) | ||
| ``` | ||
| </TabItem> |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Import path consistency with custom output
This page configures a custom output path for Prisma Client. The PostgreSQL example correctly imports from ./generated/prisma — please align the other examples (D1, PlanetScale, Neon) to import from the same path.
Consider running this search to catch mismatches in this file:
🏁 Script executed:
#!/bin/bash
rg -n -C2 -P 'import\s+\{?\s*PrismaClient\s*\}?\s+from\s+[\'"]@prisma/client[\'"]' content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdxLength of output: 116
I’ll correct the regex quoting and search for any remaining imports from @prisma/client in the file:
🏁 Script executed:
#!/usr/bin/env bash
rg -n -C2 -P "import\s+\{?\s*PrismaClient\s*\}?\s+from\s+['\"]@prisma/client['\"]" content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdxLength of output: 1250
Align PrismaClient import paths across all database examples
The PostgreSQL example correctly uses the custom output path:
import { PrismaClient } from './generated/prisma'Please update the other examples (D1, PlanetScale, Neon) to import from the same path. In each snippet below, replace:
- import { PrismaClient } from '@prisma/client'
+ import { PrismaClient } from './generated/prisma'Locations in content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx:
- D1 examples: lines 116 and 318
- PlanetScale examples: lines 153 and 355
- Neon Serverless examples: lines 196 and 398
🧰 Tools
🪛 LanguageTool
[grammar] ~101-~101: There might be a mistake here.
Context: ...ctionString: process.env.DATABASE_URL }) const prisma = new PrismaClient({ adapte...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In
content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx
around lines 116, 153, 196, 318, 355 and 398, the PrismaClient import paths in
the D1, PlanetScale, and Neon Serverless examples do not match the custom output
path used in the PostgreSQL example; update each example's import line to import
PrismaClient from './generated/prisma' instead of the current path so all
database snippets use the same generated client location.
| import { PrismaClient } from '@prisma/client' | ||
| import { PrismaD1 } from '@prisma/adapter-d1' | ||
|
|
||
| export interface Env { | ||
| DB: D1Database | ||
| } | ||
|
|
||
| export default { | ||
| async fetch( | ||
| request: Request, | ||
| env: Env, | ||
| ctx: ExecutionContext | ||
| ): Promise<Response> { | ||
| const adapter = new PrismaD1(env.DB) | ||
| const prisma = new PrismaClient({ adapter }) | ||
|
|
||
| // ... query your DB | ||
| }, | ||
| } | ||
| ``` |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Align D1 example import with configured output path
The generator uses a custom output; import should match.
Proposed edit:
-import { PrismaClient } from '@prisma/client'
+import { PrismaClient } from './generated/prisma'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { PrismaClient } from '@prisma/client' | |
| import { PrismaD1 } from '@prisma/adapter-d1' | |
| export interface Env { | |
| DB: D1Database | |
| } | |
| export default { | |
| async fetch( | |
| request: Request, | |
| env: Env, | |
| ctx: ExecutionContext | |
| ): Promise<Response> { | |
| const adapter = new PrismaD1(env.DB) | |
| const prisma = new PrismaClient({ adapter }) | |
| // ... query your DB | |
| }, | |
| } | |
| ``` | |
| import { PrismaClient } from './generated/prisma' | |
| import { PrismaD1 } from '@prisma/adapter-d1' | |
| export interface Env { | |
| DB: D1Database | |
| } | |
| export default { | |
| async fetch( | |
| request: Request, | |
| env: Env, | |
| ctx: ExecutionContext | |
| ): Promise<Response> { | |
| const adapter = new PrismaD1(env.DB) | |
| const prisma = new PrismaClient({ adapter }) | |
| // ... query your DB | |
| }, | |
| } |
🧰 Tools
🪛 LanguageTool
[grammar] ~119-~119: There might be a mistake here.
Context: ...isma/adapter-d1' export interface Env { DB: D1Database } export default { asy...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In
content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx
around lines 116-135, the example imports PrismaD1 from '@prisma/adapter-d1' but
the project uses a custom Prisma client output; update the import to use the
configured client output path so the adapter comes from the same generated
package (for example, import PrismaD1 from the Prisma client output like
'@prisma/client/adapter-d1' or the exact custom output path configured in your
schema), ensuring both PrismaClient and PrismaD1 are imported from the
generator's output.
| import { PrismaPlanetScale } from '@prisma/adapter-planetscale' | ||
| import { PrismaClient } from '@prisma/client' | ||
| import { fetch as undiciFetch } from 'undici' | ||
|
|
||
| const adapter = new PrismaPlanetScale({ url: process.env.DATABASE_URL, fetch: undiciFetch }) | ||
| const prisma = new PrismaClient({ adapter }) | ||
| ``` |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Align PlanetScale example import with configured output path
Proposed edit:
-import { PrismaClient } from '@prisma/client'
+import { PrismaClient } from './generated/prisma'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { PrismaPlanetScale } from '@prisma/adapter-planetscale' | |
| import { PrismaClient } from '@prisma/client' | |
| import { fetch as undiciFetch } from 'undici' | |
| const adapter = new PrismaPlanetScale({ url: process.env.DATABASE_URL, fetch: undiciFetch }) | |
| const prisma = new PrismaClient({ adapter }) | |
| ``` | |
| import { PrismaPlanetScale } from '@prisma/adapter-planetscale' | |
| import { PrismaClient } from './generated/prisma' | |
| import { fetch as undiciFetch } from 'undici' | |
| const adapter = new PrismaPlanetScale({ url: process.env.DATABASE_URL, fetch: undiciFetch }) | |
| const prisma = new PrismaClient({ adapter }) |
🧰 Tools
🪛 LanguageTool
[grammar] ~156-~156: There might be a mistake here.
Context: ....env.DATABASE_URL, fetch: undiciFetch }) const prisma = new PrismaClient({ adapte...
(QB_NEW_EN)
🤖 Prompt for AI Agents
In
content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx
around lines 152–158, the example imports PrismaPlanetScale from a hardcoded
module path that may not match the project's configured Prisma client output
path; update the import so the adapter is imported from the same output path
used for PrismaClient (e.g., change the PrismaPlanetScale import specifier to
the configured client output package/path used in your prisma.schema so both
imports come from the same location), keeping the rest of the example intact.
| import { PrismaClient } from '@prisma/client' | ||
| import { PrismaNeon } from '@prisma/adapter-neon' | ||
| import dotenv from 'dotenv' | ||
|
|
||
| dotenv.config() | ||
| const connectionString = `${process.env.DATABASE_URL}` | ||
|
|
||
| const adapter = new PrismaNeon({ connectionString }) | ||
| const prisma = new PrismaClient({ adapter }) | ||
| ``` |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Align Neon Serverless example import with configured output path
Proposed edit:
-import { PrismaClient } from '@prisma/client'
+import { PrismaClient } from './generated/prisma'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { PrismaClient } from '@prisma/client' | |
| import { PrismaNeon } from '@prisma/adapter-neon' | |
| import dotenv from 'dotenv' | |
| dotenv.config() | |
| const connectionString = `${process.env.DATABASE_URL}` | |
| const adapter = new PrismaNeon({ connectionString }) | |
| const prisma = new PrismaClient({ adapter }) | |
| ``` | |
| import { PrismaClient } from './generated/prisma' | |
| import { PrismaNeon } from '@prisma/adapter-neon' | |
| import dotenv from 'dotenv' | |
| dotenv.config() | |
| const connectionString = `${process.env.DATABASE_URL}` | |
| const adapter = new PrismaNeon({ connectionString }) | |
| const prisma = new PrismaClient({ adapter }) |
🤖 Prompt for AI Agents
In
content/200-orm/200-prisma-client/000-setup-and-configuration/300-no-rust-engine.mdx
around lines 196 to 205, the Neon Serverless example imports PrismaNeon from a
generic package path that may not match the project's configured Prisma client
output path; update the import to the actual adapter output path used in the
project's Prisma configuration (the path where PrismaNeon is exported), and make
sure the example uses the same resolved import path as your generated client so
the snippet works as-is for readers.
| As of [v6.15.0](https://pris.ly/release/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). | ||
|
|
||
| **When enabled, your Prisma Client will be generated [without a Rust-based query engine binary](/orm/prisma-client/setup-and-configuration/no-rust-engine)**: | ||
| **When enabled, your Prisma Client will be generated without a Rust-based query engine binary**: | ||
|
|
||
| ```prisma | ||
| generator client { | ||
| provider = "prisma-client-js" | ||
| previewFeatures = ["queryCompiler", "driverAdapters"] | ||
| provider = "prisma-client-js" // or "prisma-client" | ||
| output = "../src/generated/prisma" | ||
| engineType = "client" // no Rust engine | ||
| } | ||
| ``` | ||
|
|
||
| Note that the [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) Preview feature is required alongside `queryCompiler`. | ||
| Note that [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) are required if you want to use Prisma ORM without Rust engines. | ||
|
|
||
| You can [learn more](https://www.prisma.io/blog/rust-to-typescript-update-boosting-prisma-orm-performance) about the change on our blog. | ||
| You can [read about the performance and DX improvements](https://www.prisma.io/blog/prisma-orm-without-rust-latest-performance-benchmarks) of this change on our blog. | ||
|
|
||
| ::: |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Good addition; resolve conflict with “Configuring the query engine” section below.
This note introduces engineType = "client" for the no-Rust flow, but the “Defining the query engine type for Prisma Client” section later lists only binary and library as valid values. Please update that section to reflect client or clearly scope it to Rust engines.
Proposed updated content for Lines 236-244 (illustrative):
// When using Rust engines, you can choose between 'library' (default) and 'binary'
generator client {
provider = "prisma-client-js"
engineType = "library" // or "binary"
}
// When using Prisma without Rust engines, set:
generator client {
provider = "prisma-client-js" // or "prisma-client"
engineType = "client"
}Also consider amending Line 243 to: “Valid values for Rust engines are binary and library. For the no-Rust flow, use client.”
#!/bin/bash
# Locate the engines documentation file
file=$(fd --type f '100-engines.mdx' content/)
echo "Found file: $file"
echo "---- Context around 'Defining the query engine type' ----"
rg -nC3 "Defining the query engine type" "$file"
echo "---- All mentions of engineType ----"
rg -nC3 "engineType" "$file"🏁 Script executed:
#!/bin/bash
# Locate the engines documentation file
file=$(fd --type f '100-engines.mdx' content)
echo "Found file: $file"
# Show the section defining engineType options
echo "---- ‘Defining the query engine type’ section ----"
rg -nC3 "Defining the query engine type" "$file"
# Show all engineType mentions in context
echo "---- All ‘engineType’ mentions ----"
rg -nC3 "engineType" "$file"Length of output: 2477
Include client in the “Defining the query engine type for Prisma Client” section
The section at content/200-orm/800-more/100-under-the-hood/100-engines.mdx (around lines 236–244) still only shows the Rust engine options (binary and library), but we’ve introduced engineType = "client" for the no-Rust flow. Please update this section to cover both scenarios:
• File & Location
– content/200-orm/800-more/100-under-the-hood/100-engines.mdx lines 236–244
• Proposed replacement:
- ```prisma
- generator client {
- provider = "prisma-client-js"
- engineType = "binary"
- }
- ```
-
- Valid values for `engineType` are `binary` and `library`. You can also use the environment variable [`PRISMA_CLIENT_ENGINE_TYPE`](/orm/reference/environment-variables-reference#prisma_client_engine_type) instead.
+ ```prisma
+ // When using Rust engines
+ generator client {
+ provider = "prisma-client-js"
+ engineType = "library" // default
+ // or engineType = "binary"
+ }
+
+ // When using Prisma without Rust engines
+ generator client {
+ provider = "prisma-client-js" // or "prisma-client"
+ engineType = "client"
+ }
+ ```
+
+ Valid values for `engineType`:
+ - `library` and `binary` (for Rust engines)
+ - `client` (for the no-Rust flow)
+
+ You can still use the environment variable [`PRISMA_CLIENT_ENGINE_TYPE`](/orm/reference/environment-variables-reference#prisma_client_engine_type).🤖 Prompt for AI Agents
In content/200-orm/800-more/100-under-the-hood/100-engines.mdx around lines
236–244, the “Defining the query engine type for Prisma Client” section only
shows Rust engine options and must be updated to include the no-Rust `engineType
= "client"` option; replace the existing snippet with two example generator
blocks (one showing Rust engines with engineType = "library" or "binary", and
one showing the no-Rust generator with engineType = "client"), update the “Valid
values for `engineType`” list to include `library`, `binary` (for Rust engines)
and `client` (for no-Rust flow), and keep the note about the
`PRISMA_CLIENT_ENGINE_TYPE` environment variable.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (6)
content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (6)
48-58: Avoid mixingprisma-client-jswithoutputin the no‑Rust example to prevent confusion.
prisma-client-jsconventionally generates intonode_modules; showing it alongside a requiredoutputpath sends mixed signals. Recommend using onlyprisma-clientin this example.Additionally, keep the release link path consistent with later usage (
/releases/).Apply:
-As of [v6.15.0](https://pris.ly/release/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). +As of [v6.15.0](https://pris.ly/releases/6.15.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine).generator client { - provider = "prisma-client-js" // or "prisma-client" + provider = "prisma-client" output = "../src/generated/prisma" engineType = "client" // no Rust engine }If you do intend to document no‑Rust with
prisma-client-js, please add a separate snippet withoutoutputto reflect its typical generation behavior intonode_modules.
60-63: Tighten phrasing around whenbinaryTargetsis obsolete.Make the condition explicit to the configuration knob users set.
-When using Prisma ORM without Rust, the `binaryTargets` field is obsolete and not needed. +When using Prisma ORM with `engineType = "client"`, the `binaryTargets` field is obsolete and not needed.
101-105: Minor grammar: “any more” → “anymore”; add link to the new field reference.
- Use the adverb “anymore”.
- The “additional fields” link is great; consider keeping the style consistent across the section.
-- Requires an `output` path; no "magic" generation into `node_modules` any more +- Requires an `output` path; no "magic" generation into `node_modules` anymore - Doesn't load `.env` at runtime; use `dotenv` or set environment variables manually instead - Supports ESM and CommonJS via the `moduleFormat` field - More flexible thanks to additional [fields](#field-reference) - Outputs plain TypeScript that's bundled just like the rest of your application code
107-108: Grammar and link consistency.Add a conjunction and keep the release link path consistent with earlier usage.
-The `prisma-client` generator has been Generally Available since [v6.15.0](https://pris.ly/releases/6.15.0) will become the new default with Prisma ORM v7. +The `prisma-client` generator has been Generally Available since [v6.15.0](https://pris.ly/releases/6.15.0) and will become the new default with Prisma ORM v7.
144-156: Clarify that inclusion of a query engine binary depends on the configured engine type.As written, it always implies a Rust binary is generated. That’s only true when not using
engineType = "client".-This generates the code for Prisma Client (including the query engine binary) into the specified `output` folder. +This generates the Prisma Client code into the specified `output` folder. If you have not enabled the no‑Rust engine (`engineType = "client"`), the output will also include the platform‑specific query engine binary.-# Keep the generated Prisma Client + query engine out of version control +# Keep the generated Prisma Client out of version control +# If using Rust engines (default), this also excludes the platform‑specific query engine binary /src/generated/prisma
239-256: Reflect no‑Rust output shape (no.nodebinary) or add a brief note.The “After” tree shows a
libquery_engine-*.node, which won’t exist whenengineType = "client". Add a one‑liner to avoid readers assuming it’s always present.└── prisma ├── client.ts @@ └── models.ts
+Note: If you configure
engineType = "client", the platform-specificlibquery_engine-*.nodebinary will not be present.</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 89631fab1546ec42d6ac6ad01c4081b1ec88c219 and 604eb5968de83cad754ed292faea84adb48295ea. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `content/200-orm/100-prisma-schema/10-overview/03-generators.mdx` (4 hunks) * `content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx` (2 hunks) </details> <details> <summary>✅ Files skipped from review due to trivial changes (1)</summary> * content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (2)</summary> <details> <summary>📓 Common learnings</summary>Learnt from: ankur-arch
PR: #7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools likeprisma migrateorprisma db pull. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.</details> <details> <summary>📚 Learning: 2025-08-11T09:40:55.237Z</summary>Learnt from: ankur-arch
PR: #7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools likeprisma migrateorprisma db pull. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.**Applied to files:** - `content/200-orm/100-prisma-schema/10-overview/03-generators.mdx` </details> </details><details> <summary>🪛 LanguageTool</summary> <details> <summary>content/200-orm/100-prisma-schema/10-overview/03-generators.mdx</summary> [uncategorized] ~101-~101: Did you mean the adverb “anymore”? Context: ... "magic" generation into `node_modules` any more - Doesn't load `.env` at runtime; use `... (ANY_MORE) </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). (3)</summary> * GitHub Check: runner / linkspector * GitHub Check: Check internal links * GitHub Check: Lost Pixel </details> <details> <summary>🔇 Additional comments (2)</summary><blockquote> <details> <summary>content/200-orm/100-prisma-schema/10-overview/03-generators.mdx (2)</summary> `21-21`: **Nice clarity on the new `prisma-client` generator.** The bullet succinctly distinguishes `prisma-client` from `prisma-client-js` and sets the expectation about `output`. Looks good. --- `91-99`: **Good elevation and positioning of the new generator.** Promoting `prisma-client` into its own section and framing its value props (ESM, split output, plain TS) is clear and helpful. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
content/800-guides/240-management-api.mdx (5)
28-31: Grammar fix: “allow you to programmatically …”Minor wording improvement for clarity.
- - **Management API**: A set of endpoints that allow to programmatically provision and manage Prisma Postgres databases. + - **Management API**: A set of endpoints that allow you to programmatically provision and manage Prisma Postgres databases.Optional: Standardize “OAuth 2” as “OAuth 2.0” across the page for precision.
51-60: Align header placeholder with “service token” terminologyUpdate the sample to consistently reference the service token.
- Authorization: `Bearer <YOUR_INTEGRATION_TOKEN>`, + Authorization: `Bearer <YOUR_SERVICE_TOKEN>`,
78-100: Consider adding PKCE to the OAuth authorization requestFor public or hybrid flows initiated from the browser, PKCE is recommended. Even when doing the code exchange on the backend, including PKCE improves security against code interception.
If appropriate for your audience, add a short note and example showing PKCE parameters in the authorization URL and persisting the code_verifier server-side:
// Server: generate and store a codeVerifier (e.g., in a server session) // Derive codeChallenge = base64url(SHA256(codeVerifier)) const authParams = new URLSearchParams({ client_id: YOUR_CLIENT_ID, redirect_uri: 'https://your-app.com/auth/callback', response_type: 'code', scope: 'workspace:admin', state: generateState(), code_challenge: codeChallenge, // PKCE code_challenge_method: 'S256', // PKCE });Note: Keep the code_verifier secret on the server; never expose client_secret in the browser.
106-125: Emphasize server-side token exchange and add basic error handling (and PKCE support if used)Since client_secret is used, explicitly note this must run on the server. Add minimal error handling to avoid misleading readers into assuming success, and include code_verifier if PKCE is recommended above.
const tokenResponse = await fetch('https://auth.prisma.io/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ grant_type: 'authorization_code', code: code, // The code received from the callback redirect_uri: 'https://your-app.com/auth/callback', // Must match the redirect_uri used in step 1 client_id: YOUR_CLIENT_ID, client_secret: YOUR_CLIENT_SECRET, + // If you initiated the flow with PKCE, include the verifier: + // code_verifier: codeVerifier, }).toString(), }); -const tokenData = await tokenResponse.json(); +if (!tokenResponse.ok) { + throw new Error(`Token exchange failed with status ${tokenResponse.status}`); +} +const tokenData = await tokenResponse.json(); // { access_token, expires_in, token_type, ... }Add one sentence before the snippet: “Perform the following exchange on your backend (never in the browser).”
130-138: Double-check transfer API contract and avoid exposing/logging tokensThe example passes the integration token via Authorization and the user’s access token in the request body. If this matches the Management API spec (recipientAccessToken field), great—otherwise align with the official parameter name or header requirements.
Also, consider adding a brief caution: do not log access tokens; keep both tokens server-side.
Optional tweak to keep terminology consistent:
- Authorization: `Bearer ${YOUR_INTEGRATION_TOKEN}`, + Authorization: `Bearer ${YOUR_SERVICE_TOKEN}`,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
content/800-guides/240-management-api.mdx(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ankur-arch
PR: prisma/docs#7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.
🪛 LanguageTool
content/800-guides/240-management-api.mdx
[grammar] ~28-~28: There might be a mistake here.
Context: ...on and manage Prisma Postgres databases. - Projects vs Databases: A project is a ...
(QB_NEW_EN)
⏰ 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). (3)
- GitHub Check: Check internal links
- GitHub Check: runner / linkspector
- GitHub Check: Lost Pixel
🔇 Additional comments (3)
content/800-guides/240-management-api.mdx (3)
32-33: Token terminology looks good“Service token” and “OAuth 2 access token” are clear and aligned with the rest of the page.
68-76: Clear overview of the claim flowThe high-level steps and security rationale are well laid out. Good inclusion of the state parameter in the subsequent section.
102-105: Good explanation of the callback parametersCalling out state and possible project_id in the callback is helpful for implementers.
| 2. **Authenticate your integration**: Use your integration token (obtained via OAuth2) to authenticate API requests. This token authenticates your app as an approved partner. | ||
| 3. **Send a database provisioning request**: Make a `POST` request to the Management API endpoint to create a new project with a default database. For example: |
There was a problem hiding this comment.
Service token vs. OAuth flow: fix incorrect guidance
A service token isn’t obtained via OAuth; it’s issued to your partner integration during onboarding and used by your backend to provision/manage resources. Suggest correcting the wording to avoid partners attempting an OAuth flow for service tokens.
-2. **Authenticate your integration**: Use your integration token (obtained via OAuth2) to authenticate API requests. This token authenticates your app as an approved partner.
+2. **Authenticate your integration**: Use your service token to authenticate API requests from your backend. This token authenticates your app as an approved partner.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 2. **Authenticate your integration**: Use your integration token (obtained via OAuth2) to authenticate API requests. This token authenticates your app as an approved partner. | |
| 3. **Send a database provisioning request**: Make a `POST` request to the Management API endpoint to create a new project with a default database. For example: | |
| 2. **Authenticate your integration**: Use your service token to authenticate API requests from your backend. This token authenticates your app as an approved partner. | |
| 3. **Send a database provisioning request**: Make a `POST` request to the Management API endpoint to create a new project with a default database. For example: |
🤖 Prompt for AI Agents
In content/800-guides/240-management-api.mdx around lines 49 to 50, the wording
incorrectly states a service token is obtained via OAuth2; update the text to
clarify that a service token is issued to the partner integration during
onboarding (not via OAuth) and is used by the backend to provision/manage
resources, and keep OAuth2 referenced only for obtaining an integration (user)
token—adjust the sentence to clearly separate the two token types and their
acquisition methods.
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
content/800-guides/240-management-api.mdx (1)
141-149: Transfer request should also use the service token (rename placeholder for consistency)Align the transfer call with the correct token type.
- Authorization: `Bearer ${YOUR_INTEGRATION_TOKEN}`, + Authorization: `Bearer ${YOUR_SERVICE_TOKEN}`,
♻️ Duplicate comments (2)
content/800-guides/240-management-api.mdx (2)
61-62: Service token vs. OAuth flow: fix incorrect guidanceThis still incorrectly states a service/integration token is obtained via OAuth. It should instruct partners to use their service token from onboarding.
-2. **Authenticate your integration**: Use your integration token (obtained via OAuth2) to authenticate API requests. This token authenticates your app as an approved partner. +2. **Authenticate your integration**: Use your service token to authenticate API requests from your backend. This token authenticates your app as an approved partner.
30-33: Clarify token types: service token vs. OAuth 2 user token (avoid implying OAuth for service tokens)Service tokens are issued during partner onboarding and are not obtained via OAuth. OAuth 2 is used only to obtain a user access token during the claim flow. Suggest rewording for accuracy and consistency.
-**Authentication**: All API requests require authentication. As a partner, you use OAuth2 to obtain integration tokens (for your app) and facilitate secure transfers to your users. -**Tokens**: There are two main types of tokens: - - **Service token**: Issued to your partner integration, scoped to provision and manage databases on your own workspace. - - **OAuth 2 access token**: Obtained via OAuth2 when a user authenticates with your app, scoped to the user's workspace and can be used to transfer database ownership to the user's workspace. +**Authentication**: All API requests require authentication. As a partner, you authenticate Management API requests with your service token. During the claim flow, you use OAuth 2 to obtain a user access token to authorize transfers into the user’s workspace. +**Tokens**: There are two main types of tokens: + - **Service token**: Issued to your partner integration during onboarding; scoped to provision and manage databases in your workspace. + - **OAuth 2 access token**: Obtained via OAuth 2 when a user authenticates with your app; scoped to the user’s workspace and used to authorize transferring project ownership to the user.
🧹 Nitpick comments (4)
content/800-guides/240-management-api.mdx (4)
14-14: Standardize terminology: use “OAuth 2” consistentlyThe doc mixes “OAuth2” and “OAuth 2”. Pick one (suggest “OAuth 2”) and use it consistently across the page.
-... secured using OAuth2, ... +... secured using OAuth 2, ...-1. Trigger the OAuth2 flow, redirecting the user to Prisma Auth. +1. Trigger the OAuth 2 flow, redirecting the user to Prisma Auth.-- Construct an OAuth2 authorization URL with your client ID, redirect URI, and required scopes. +- Construct an OAuth 2 authorization URL with your client ID, redirect URI, and required scopes.- scope: 'workspace:admin', // The scope of the OAuth2 authorization + scope: 'workspace:admin', // The scope of the OAuth 2 authorization-- Implement a secure claim flow that allows users to claim ownership of a database in their own workspace using OAuth2 +- Implement a secure claim flow that allows users to claim ownership of a database in their own workspace using OAuth 2Also applies to: 80-87, 96-99, 107-107, 160-160
46-55: Polish the “Get OAuth credentials” steps (grammar + add a security note)Minor grammar fixes and a brief note on handling client secrets securely.
-To obtain a client ID and client secret, you need go through this flow: +To obtain a client ID and client secret, you need to go through this flow:-1. In the **Published Applications** section, click **New Application** button to start the flow for creating a new OAuth app +1. In the **Published Applications** section, click the **New application** button to start creating a new OAuth app-1. Enter a **Name**, **Description** and **Callback URL** for your OAuth app. +1. Enter a **Name**, **Description**, and **Callback URL** for your OAuth app.On the next screen, you can access and save the client ID and client secret for your OAuth app. + +:::caution Security +Treat your client secret like a password—store it securely on your backend and never expose it in browser or mobile clients. +:::
122-123: Explicitly validate thestatebefore exchanging the codeYou generate a
stateearlier; call out validation before the token exchange to prevent CSRF.-1. **Exchange the authorization code for a user access token**: +1. **Validate `state`, then exchange the authorization code for a user access token**:Optionally, show a brief check before the exchange in the code sample:
// Verify the returned `state` matches what you generated for this session if (!validateState(returnedStateFromCallback)) { throw new Error('Invalid state'); }
28-28: Grammar: “allow to programmatically” → “let you programmatically”Small grammar improvement.
-- **Management API**: A set of endpoints that allow to programmatically provision and manage Prisma Postgres databases. +- **Management API**: A set of endpoints that let you programmatically provision and manage Prisma Postgres databases.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
content/800-guides/240-management-api.mdx(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ankur-arch
PR: prisma/docs#7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.
🪛 LanguageTool
content/800-guides/240-management-api.mdx
[grammar] ~28-~28: There might be a mistake here.
Context: ...on and manage Prisma Postgres databases. - Projects vs Databases: A project is a ...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...he flow for creating a new OAuth app 1. Enter a Name, Description and **C...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...Callback URL for your OAuth app. 1. Click Continue. On the next screen, ...
(QB_NEW_EN)
⏰ 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). (3)
- GitHub Check: runner / linkspector
- GitHub Check: Check internal links
- GitHub Check: Lost Pixel
| ```ts | ||
| const prismaResponse = await fetch('https://api.prisma.io/v1/projects', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| Authorization: `Bearer <YOUR_INTEGRATION_TOKEN>`, | ||
| }, | ||
| body: JSON.stringify({ region, name }), | ||
| }); | ||
| ``` |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Use service token in the provisioning example (placeholder and header name)
The example should use the service token, not an “integration token” obtained via OAuth.
- Authorization: `Bearer <YOUR_INTEGRATION_TOKEN>`,
+ Authorization: `Bearer <YOUR_SERVICE_TOKEN>`,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ```ts | |
| const prismaResponse = await fetch('https://api.prisma.io/v1/projects', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| Authorization: `Bearer <YOUR_INTEGRATION_TOKEN>`, | |
| }, | |
| body: JSON.stringify({ region, name }), | |
| }); | |
| ``` |
🤖 Prompt for AI Agents
In content/800-guides/240-management-api.mdx around lines 63 to 72, the
provisioning example currently shows an OAuth-style integration token; update
the request to use a service token by replacing the Authorization header and
placeholder: change the header key to "Service-Token" and the placeholder value
to "<YOUR_SERVICE_TOKEN>" (i.e., use your service token rather than an
integration/OAuth token) so the example demonstrates the correct authentication
method.
|
@nikolasburk I'm closing this PR as I'm moved the relevant changes to my PR already #7083 |
|
I'm reopening the PR since a lot of it (hopefully) can be removed for 6.16.0 |
|
closing in favor of a dedicated PR after all: #7096 |
Summary by CodeRabbit