-
Notifications
You must be signed in to change notification settings - Fork 876
feat: add bun guide #7092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add bun guide #7092
Conversation
WalkthroughAdds a new Bun + Prisma + Postgres guide at Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant BunServer as Bun Server (index.ts)
participant Prisma as PrismaClient (PrismaPg adapter)
participant Postgres as PostgreSQL
User->>BunServer: HTTP GET /
activate BunServer
BunServer->>Prisma: findMany(User) & count()
activate Prisma
Prisma->>Postgres: SQL (via PrismaPg, using DIRECT_URL)
activate Postgres
Postgres-->>Prisma: rows, count
deactivate Postgres
Prisma-->>BunServer: users[], total
deactivate Prisma
BunServer-->>User: JSON { users, total }
deactivate BunServer
note over Prisma,Postgres: Adapter configured via PrismaPg and DIRECT_URL
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
🪧 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:
|
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 78.1%, saving 245.3 KB.
|
Deploying docs with
|
| Latest commit: |
11ea75c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://950eb90d.docs-51g.pages.dev |
| Branch Preview URL: | https://dc-4955.docs-51g.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
content/800-guides/370-bun.mdx (2)
183-191: Fix duplicate numbering (“3.2” appears twice).Rename this heading to keep the sequence consistent.
- ### 3.2. Create Prisma Config file to run the seed script + ### 3.3. Create Prisma Config file to run the seed script
17-18: US English and minor grammar cleanups.
- “installed in your system” → “installed on your system”
- “initialise” → “initialize”
- Consider shortening “work exactly the same as before” → “work the same as before”.
- - [Bun](https://bun.sh/docs/installation) installed in your system + - [Bun](https://bun.sh/docs/installation) installed on your system - Then, initialise a new Bun project: + Then, initialize a new Bun project: - ...work exactly the same as before. + ...work the same as before.Also applies to: 30-36, 274-299
📜 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 ignored due to path filters (1)
static/img/guides/prisma-bun-cover.pngis excluded by!**/*.png
📒 Files selected for processing (2)
content/800-guides/370-bun.mdx(1 hunks)sidebars.ts(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/800-guides/370-bun.mdx
[grammar] ~17-~17: There might be a mistake here.
Context: ...s/installation) installed in your system - A Prisma Postgres database ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...abase](/postgres) (created during setup) - Basic knowledge of JavaScript/TypeScript...
(QB_NEW_EN)
[uncategorized] ~49-~49: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...@prisma/adapter-pg dotenv ``` ### 2.2. Initialize Prisma ORM with Prisma Postgres Initia...
(EN_WORD_COHERENCY)
[uncategorized] ~50-~50: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...ialize Prisma ORM with Prisma Postgres Initialize Prisma ORM with Prisma Postgres in your...
(EN_WORD_COHERENCY)
[grammar] ~65-~65: There might be a mistake here.
Context: ...directory with your schema.prisma file - A new Prisma Postgres database - A `.env...
(QB_NEW_EN)
[grammar] ~66-~66: There might be a mistake here.
Context: ...afile - A new Prisma Postgres database - A.envfile with yourDATABASE_URL` ...
(QB_NEW_EN)
[grammar] ~183-~183: There might be a mistake here.
Context: ...isma.$disconnect(); }); ``` ### 3.2. Create Prisma Config file to run the seed scri...
(QB_NEW_EN)
[style] ~298-~298: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...message, and your application will work exactly the same as before. The executable includes all ...
(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)
[grammar] ~317-~317: There might be a mistake here.
Context: ...with additional models and relationships - Implementing authentication and authoriz...
(QB_NEW_EN)
[grammar] ~318-~318: There might be a mistake here.
Context: ...menting authentication and authorization - Adding input validation and error handli...
(QB_NEW_EN)
[grammar] ~319-~319: There might be a mistake here.
Context: ...ding input validation and error handling - Exploring Bun's built-in testing tools -...
(QB_NEW_EN)
[grammar] ~320-~320: There might be a mistake here.
Context: ...- Exploring Bun's built-in testing tools - Deploying your executable to production ...
(QB_NEW_EN)
[grammar] ~325-~325: There might be a mistake here.
Context: ...ers ### More info - Bun Documentation - [Prisma Driver Adapters](/orm/overview/da...
(QB_NEW_EN)
[grammar] ~326-~326: There might be a mistake here.
Context: ...//bun.sh/docs) - Prisma Driver Adapters - [Prisma Config File](/orm/reference/prism...
(QB_NEW_EN)
[grammar] ~327-~327: There might be a mistake here.
Context: .../database-drivers) - Prisma Config File - [Prisma Client without the Rust engine](/...
(QB_NEW_EN)
🔇 Additional comments (5)
sidebars.ts (1)
432-439: LGTM: Added “guides/bun” entry fits the sorted list.Alphabetical order is preserved via .sort(). Please just verify the MDX doc resolves to id "guides/bun"; if there’s any mismatch, add slug: /guides/bun in the page frontmatter.
content/800-guides/370-bun.mdx (4)
193-202: Good use of prisma.config.ts for seeding.migrations.seed is the correct place for the command in Prisma Config GA.
Ref: Prisma Config reference and 6.13 release notes (migrations.seed). (prisma.io, newreleases.io)
96-109: Generator config looks right for Bun + adapters (preview features).provider: "prisma-client", output, runtime = "bun", and previewFeatures include driverAdapters + queryCompiler. Make sure project uses Prisma >= 6.7.0.
Refs: No-Rust engine + generator/runtime docs. (prisma.io)
85-90: Nice: DIRECT_URL usage with Prisma Postgres direct TCP + adapter.The env var guidance and adapter instantiation are consistent with direct connections.
Refs: Direct connections overview and adapter instantiation examples. (prisma.io)
Also applies to: 131-141
6-6: Cover image path verified. The filestatic/img/guides/prisma-bun-cover.pngexists.
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 22%, saving 15.1 KB.
|
Co-authored-by: Nurul Sundarani <sundarani@prisma.io>
7ad5a09
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 21%, saving 11.3 KB.
|
ea51c63
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
content/800-guides/370-bun.mdx (2)
217-221: Remove the “generate again” step; migrate dev already generates artifacts.
prisma migrate devapplies migrations and triggers Client generation. Keep a note only if users changed generator config afterward.-Because you are using the `node-postgres` driver adapter, you will need to generate the `PrismaClient` again. The client automatically produced by `migrate dev` is optimized for Prisma Postgres, but the adapter requires a client built specifically for the driver: - -```terminal -bun prisma generate -``` +<!-- Optional: If you changed the generator configuration after running `migrate dev`, run `bun prisma generate` to regenerate the client. -->Ref: migrate dev “triggers the generation of artifacts (for example, Prisma Client)”. (prisma.io)
148-151: Seed script will fail without the adapter-backed client.With driver adapters enabled,
new PrismaClient()must receive the adapter; reuse the configured client fromdb.ts.-import { PrismaClient } from "../generated/prisma/client"; - -const prisma = new PrismaClient(); +import { prisma } from "../db";This aligns with Prisma’s driver adapter requirements. (prisma.io)
🧹 Nitpick comments (4)
content/800-guides/370-bun.mdx (4)
136-141: Validate DIRECT_URL and avoid coerced “undefined”.Guard the env var to fail fast and improve DX.
-const connectionString = `${process.env.DIRECT_URL}`; +const connectionString = process.env.DIRECT_URL; +if (!connectionString) { + throw new Error('Missing DIRECT_URL in .env'); +}
211-216: Add a short note that Node.js must be present for generate/migrate.Prisma’s generation still requires Node.js even when using Bun; a brief callout prevents confusion.
This command: - Creates the database tables based on your schema - Generates the Prisma client in the `generated/prisma` directory + +:::note +Prisma CLI generation currently requires Node.js to be installed (18+), even when using Bun, for commands like `prisma generate` and `migrate dev`. +:::(bun.com, github.com, prisma.io)
30-34: Standardize to American English (“initialize”).-Then, initialise a new Bun project: +Then, initialize a new Bun project:
183-186: Fix duplicated step number (3.2 → 3.3).-### 3.2. Create Prisma Config file to run the seed script +### 3.3. Create Prisma Config file to run the seed script
📜 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 ignored due to path filters (1)
static/img/guides/prisma-bun-cover.pngis excluded by!**/*.png
📒 Files selected for processing (1)
content/800-guides/370-bun.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/800-guides/370-bun.mdx
[grammar] ~17-~17: There might be a mistake here.
Context: ...s/installation) installed in your system - A Prisma Postgres database ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...abase](/postgres) (created during setup) - Basic knowledge of JavaScript/TypeScript...
(QB_NEW_EN)
[uncategorized] ~49-~49: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...@prisma/adapter-pg dotenv ``` ### 2.2. Initialize Prisma ORM with Prisma Postgres Initia...
(EN_WORD_COHERENCY)
[uncategorized] ~50-~50: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...ialize Prisma ORM with Prisma Postgres Initialize Prisma ORM with Prisma Postgres in your...
(EN_WORD_COHERENCY)
[grammar] ~65-~65: There might be a mistake here.
Context: ...directory with your schema.prisma file - A new Prisma Postgres database - A `.env...
(QB_NEW_EN)
[grammar] ~66-~66: There might be a mistake here.
Context: ...afile - A new Prisma Postgres database - A.envfile with yourDATABASE_URL` ...
(QB_NEW_EN)
[grammar] ~183-~183: There might be a mistake here.
Context: ...isma.$disconnect(); }); ``` ### 3.2. Create Prisma Config file to run the seed scri...
(QB_NEW_EN)
[style] ~298-~298: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...message, and your application will work exactly the same as before. The executable includes all ...
(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)
[grammar] ~317-~317: There might be a mistake here.
Context: ...with additional models and relationships - Implementing authentication and authoriz...
(QB_NEW_EN)
[grammar] ~318-~318: There might be a mistake here.
Context: ...menting authentication and authorization - Adding input validation and error handli...
(QB_NEW_EN)
[grammar] ~319-~319: There might be a mistake here.
Context: ...ding input validation and error handling - Exploring Bun's built-in testing tools -...
(QB_NEW_EN)
[grammar] ~320-~320: There might be a mistake here.
Context: ...- Exploring Bun's built-in testing tools - Deploying your executable to production ...
(QB_NEW_EN)
[grammar] ~325-~325: There might be a mistake here.
Context: ...ers ### More info - Bun Documentation - [Prisma Driver Adapters](/orm/overview/da...
(QB_NEW_EN)
[grammar] ~326-~326: There might be a mistake here.
Context: ...//bun.sh/docs) - Prisma Driver Adapters - [Prisma Config File](/orm/reference/prism...
(QB_NEW_EN)
[grammar] ~327-~327: There might be a mistake here.
Context: .../database-drivers) - Prisma Config File - [Prisma Client without the Rust engine](/...
(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). (1)
- GitHub Check: runner / linkspector
🔇 Additional comments (4)
content/800-guides/370-bun.mdx (4)
96-109: Generator block looks correct for Bun + adapters.Using
provider = "prisma-client",output,runtime = "bun", and preview features is consistent with current guidance.
193-202: Good use of Prisma Config migrations.seed.Configuring seeding via
migrations.seedinprisma.config.tsis the supported shape.
85-90: DIRECT_URL guidance is accurate for Prisma Postgres + pg adapter.Keeping
DATABASE_URLfor Prisma Postgres andDIRECT_URLfor direct TCP is the right setup.
233-264: Server sample is clean and uses the shared client correctly.Imports the singleton client and handles basic routing; good example for Bun users.
There was a problem hiding this 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
♻️ Duplicate comments (4)
content/800-guides/370-bun.mdx (4)
54-55: Confirm CLI invocation: bunx prisma (or plain prisma) vs bun prisma.Bun typically runs package CLIs via bunx. If you intentionally use a global/local prisma, prefer plain prisma. Otherwise, switch to bunx and pin init to @latest.
-bun prisma init --db +bunx prisma@latest init --db @@ -bun prisma migrate dev --name init +bunx prisma migrate dev --name init @@ -bun prisma generate +bunx prisma generate @@ -bun prisma db seed +bunx prisma db seedAlso applies to: 209-210, 220-221, 226-227
217-221: “Generate again” isn’t required; migrate dev already generates.Make this optional note only if generator config changed.
-Because you are using the `node-postgres` driver adapter, you will need to generate the `PrismaClient` again. The client automatically produced by `migrate dev` is optimized for Prisma Postgres, but the adapter requires a client built specifically for the driver: - -```terminal -bun prisma generate -``` +<!-- Optional: If you modified your generator config after running `migrate dev`, run `bunx prisma generate` to regenerate the client. -->
44-47: Missing pg dependency for adapter-pg (will crash at runtime).Install pg alongside @prisma/adapter-pg.
bun add -d prisma -bun add @prisma/client @prisma/adapter-pg dotenv +bun add @prisma/client @prisma/adapter-pg pg dotenv
148-151: Seed script bypasses the adapter; reuse the configured client.Use the prisma from db.ts; otherwise seeding fails with driver adapters.
-import { PrismaClient } from "../generated/prisma/client"; - -const prisma = new PrismaClient(); +// Reuse adapter-backed client +import { prisma } from "../db"; @@ main() .catch((e) => { console.error(e); process.exit(1); }) .finally(async () => { await prisma.$disconnect(); });Also applies to: 173-181
🧹 Nitpick comments (6)
content/800-guides/370-bun.mdx (6)
183-185: Fix step numbering (duplicate “3.2”).Rename to 3.3 to keep sequence consistent.
-### 3.2. Create Prisma Config file to run the seed script +### 3.3. Create Prisma Config file to run the seed script
30-34: Unify English variant (“initialise” vs “Initialize”).Use one variant consistently; docs elsewhere use American English.
-Then, initialise a new Bun project: +Then, initialize a new Bun project:Also applies to: 49-51
17-19: Minor grammar.“on your system” reads more natural.
-- [Bun](https://bun.sh/docs/installation) installed in your system +- [Bun](https://bun.sh/docs/installation) installed on your system
85-90: .env code fence contains //add markers (invalid in .env).Ensure the site’s renderer strips these. If not, switch to # comments or remove markers.
131-141: Guard missing DIRECT_URL.Fail fast if env is absent to aid debugging.
import "dotenv/config"; import { PrismaClient } from "./generated/prisma/client"; import { PrismaPg } from "@prisma/adapter-pg"; -const connectionString = `${process.env.DIRECT_URL}`; +const connectionString = process.env.DIRECT_URL; +if (!connectionString) { + throw new Error("DIRECT_URL is not set in .env"); +} const adapter = new PrismaPg({ connectionString }); export const prisma = new PrismaClient({ adapter });
246-257: Reduce roundtrips: fetch users and count together.Use a transaction to parallelize queries.
- // Return all users - const users = await prisma.user.findMany() - - // Count all users - const count = await prisma.user.count() + // Fetch users and count concurrently + const [users, count] = await prisma.$transaction([ + prisma.user.findMany(), + prisma.user.count(), + ])
📜 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 ignored due to path filters (1)
static/img/guides/prisma-bun-cover-image.pngis excluded by!**/*.png
📒 Files selected for processing (1)
content/800-guides/370-bun.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/800-guides/370-bun.mdx
[grammar] ~17-~17: There might be a mistake here.
Context: ...s/installation) installed in your system - A Prisma Postgres database ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...abase](/postgres) (created during setup) - Basic knowledge of JavaScript/TypeScript...
(QB_NEW_EN)
[uncategorized] ~49-~49: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...@prisma/adapter-pg dotenv ``` ### 2.2. Initialize Prisma ORM with Prisma Postgres Initia...
(EN_WORD_COHERENCY)
[uncategorized] ~50-~50: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...ialize Prisma ORM with Prisma Postgres Initialize Prisma ORM with Prisma Postgres in your...
(EN_WORD_COHERENCY)
[grammar] ~65-~65: There might be a mistake here.
Context: ...directory with your schema.prisma file - A new Prisma Postgres database - A `.env...
(QB_NEW_EN)
[grammar] ~66-~66: There might be a mistake here.
Context: ...afile - A new Prisma Postgres database - A.envfile with yourDATABASE_URL` ...
(QB_NEW_EN)
[grammar] ~183-~183: There might be a mistake here.
Context: ...isma.$disconnect(); }); ``` ### 3.2. Create Prisma Config file to run the seed scri...
(QB_NEW_EN)
[style] ~298-~298: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...message, and your application will work exactly the same as before. The executable includes all ...
(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)
[grammar] ~317-~317: There might be a mistake here.
Context: ...with additional models and relationships - Implementing authentication and authoriz...
(QB_NEW_EN)
[grammar] ~318-~318: There might be a mistake here.
Context: ...menting authentication and authorization - Adding input validation and error handli...
(QB_NEW_EN)
[grammar] ~319-~319: There might be a mistake here.
Context: ...ding input validation and error handling - Exploring Bun's built-in testing tools -...
(QB_NEW_EN)
[grammar] ~320-~320: There might be a mistake here.
Context: ...- Exploring Bun's built-in testing tools - Deploying your executable to production ...
(QB_NEW_EN)
[grammar] ~325-~325: There might be a mistake here.
Context: ...ers ### More info - Bun Documentation - [Prisma Driver Adapters](/orm/overview/da...
(QB_NEW_EN)
[grammar] ~326-~326: There might be a mistake here.
Context: ...//bun.sh/docs) - Prisma Driver Adapters - [Prisma Config File](/orm/reference/prism...
(QB_NEW_EN)
[grammar] ~327-~327: There might be a mistake here.
Context: .../database-drivers) - Prisma Config File - [Prisma Client without the Rust engine](/...
(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
🔇 Additional comments (2)
content/800-guides/370-bun.mdx (2)
106-108: Verify previewFeatures and runtime fields.driverAdapters/queryCompiler may no longer require preview flags; runtime = "bun" may be inferred in recent Prisma. Please confirm against current Prisma docs and drop flags if GA.
6-6: Verify cover image path.Confirm /img/guides/prisma-bun-cover-image.png exists in the site assets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (4)
content/800-guides/370-bun.mdx (4)
54-55: CLI usage: Prefer bunx prisma (pin @latest for init) or document the local alias.For general readers,
bunx prismais the safest default; pininitto@latestto avoid cache issues. If you intentionally use a local alias, add a snippet showing the package.json script.- bun prisma init --db + bunx prisma@latest init --db- bun prisma migrate dev --name init + bunx prisma migrate dev --name init- bun prisma generate + bunx prisma generate- bun prisma db seed + bunx prisma db seedOptional (if keeping local): add to package.json
{
"scripts": { "prisma": "prisma" }
}
and usebun run prisma ....Also applies to: 209-210, 220-221, 226-227
44-47: 必修: Install the pg driver with the adapter.The PostgreSQL adapter requires the
pgpackage; without it, the app/seed will fail at runtime.bun add -d prisma -bun add @prisma/client @prisma/adapter-pg dotenv +bun add @prisma/client @prisma/adapter-pg pg dotenv
148-151: Seed script must reuse the adapter-configured client.With driver adapters enabled,
new PrismaClient()without the adapter will fail. Import the configured client.-import { PrismaClient } from "../generated/prisma/client"; - -const prisma = new PrismaClient(); +// Reuse Prisma Client configured with @prisma/adapter-pg +import { prisma } from "../db";Also applies to: 173-181
214-221: Remove the “generate again” step; migrate dev already generates the client.Generation is automatic; only re-run if you changed generator config after migration.
-This command: - -- Creates the database tables based on your schema -- Generates the Prisma client in the `generated/prisma` directory - -Because you are using the `node-postgres` driver adapter, you will need to generate the `PrismaClient` again. The client automatically produced by `migrate dev` is optimized for Prisma Postgres, but the adapter requires a client built specifically for the driver: - -```terminal -bun prisma generate -``` +This command: + +- Creates the database tables based on your schema +- Generates the Prisma client in the `generated/prisma` directory + +<!-- Optional: If you modified the generator config after running `migrate dev`, run `bunx prisma generate` to regenerate the client. -->
🧹 Nitpick comments (5)
content/800-guides/370-bun.mdx (5)
185-185: Fix internal link path consistency.Other internal links omit
/docs; this one likely 404s. Align path.-Create a [`prisma.config.ts` file](/docs/orm/reference/prisma-config-reference#migrationsseed) +Create a [`prisma.config.ts` file](/orm/reference/prisma-config-reference#migrationsseed)
30-34: US/UK spelling: Standardize on “Initialize.”-Then, initialise a new Bun project: +Then, initialize a new Bun project:
17-20: Minor grammar: “installed on your system.”-- [Bun](https://bun.sh/docs/installation) installed in your system +- [Bun](https://bun.sh/docs/installation) installed on your system
298-298: Tighten wording.-... will work exactly the same as before. +... will work the same as before.
280-299: Executable + env: document runtime env var expectations.Compiled binaries won’t find
.envif run from a different CWD; recommend exporting env vars or co-locating.envwith the working directory in deployment notes.
📜 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/370-bun.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/800-guides/370-bun.mdx
[grammar] ~17-~17: There might be a mistake here.
Context: ...s/installation) installed in your system - A Prisma Postgres database ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...abase](/postgres) (created during setup) - Basic knowledge of JavaScript/TypeScript...
(QB_NEW_EN)
[uncategorized] ~49-~49: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...@prisma/adapter-pg dotenv ``` ### 2.2. Initialize Prisma ORM with Prisma Postgres Initia...
(EN_WORD_COHERENCY)
[uncategorized] ~50-~50: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...ialize Prisma ORM with Prisma Postgres Initialize Prisma ORM with Prisma Postgres in your...
(EN_WORD_COHERENCY)
[grammar] ~65-~65: There might be a mistake here.
Context: ...directory with your schema.prisma file - A new Prisma Postgres database - A `.env...
(QB_NEW_EN)
[grammar] ~66-~66: There might be a mistake here.
Context: ...afile - A new Prisma Postgres database - A.envfile with yourDATABASE_URL` ...
(QB_NEW_EN)
[grammar] ~183-~183: There might be a mistake here.
Context: ...isma.$disconnect(); }); ``` ### 3.3. Create Prisma Config file to run the seed scri...
(QB_NEW_EN)
[style] ~298-~298: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...message, and your application will work exactly the same as before. The executable includes all ...
(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)
[grammar] ~317-~317: There might be a mistake here.
Context: ...with additional models and relationships - Implementing authentication and authoriz...
(QB_NEW_EN)
[grammar] ~318-~318: There might be a mistake here.
Context: ...menting authentication and authorization - Adding input validation and error handli...
(QB_NEW_EN)
[grammar] ~319-~319: There might be a mistake here.
Context: ...ding input validation and error handling - Exploring Bun's built-in testing tools -...
(QB_NEW_EN)
[grammar] ~320-~320: There might be a mistake here.
Context: ...- Exploring Bun's built-in testing tools - Deploying your executable to production ...
(QB_NEW_EN)
[grammar] ~325-~325: There might be a mistake here.
Context: ...ers ### More info - Bun Documentation - [Prisma Driver Adapters](/orm/overview/da...
(QB_NEW_EN)
[grammar] ~326-~326: There might be a mistake here.
Context: ...//bun.sh/docs) - Prisma Driver Adapters - [Prisma Config File](/orm/reference/prism...
(QB_NEW_EN)
[grammar] ~327-~327: There might be a mistake here.
Context: .../database-drivers) - Prisma Config File - [Prisma Client without the Rust engine](/...
(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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (3)
content/800-guides/370-bun.mdx (3)
54-55: Prefer bunx prisma (pin @latest for init), or confirm local CLI resolution.If you intend local CLI, ensure
prismais installed and Bun resolvesnode_modules/.bin. Otherwise usebunxto avoid PATH/caching issues and to ensure--dbsupport.Option A (safer/cross-env):
- bun prisma init --db + bunx prisma@latest init --db- bun prisma migrate dev --name init + bunx prisma migrate dev --name init- bun prisma generate + bunx prisma generate- bun prisma db seed + bunx prisma db seedOption B (keep local): please verify
devDependencies.prismaexists andbun --versionsupports resolving local bins viabun prisma.Also applies to: 209-210, 220-221, 226-227
217-221: Remove/reword “generate again”; migrate dev already runs generate.
prisma migrate devapplies migrations and generates Prisma Client. Only rungenerateif you changed generator config afterward.-Because you are using the `node-postgres` driver adapter, you will need to generate the `PrismaClient` again. The client automatically produced by `migrate dev` is optimized for Prisma Postgres, but the adapter requires a client built specifically for the driver: - -```terminal -bun prisma generate -``` +<!-- Optional: If you modified the generator config after running `migrate dev`, run `bunx prisma generate` to regenerate the client. -->
131-141: Validate DIRECT_URL and avoid coercing undefined to the string "undefined".Read the env var directly, fail fast if missing, and pass the raw value to the adapter.
import "dotenv/config"; import { PrismaClient } from "./generated/prisma/client"; import { PrismaPg } from "@prisma/adapter-pg"; -const connectionString = `${process.env.DIRECT_URL}`; - -const adapter = new PrismaPg({ connectionString }); +const { DIRECT_URL } = process.env; +if (!DIRECT_URL) { + throw new Error("DIRECT_URL is not set. Add it to your .env."); +} +const adapter = new PrismaPg({ connectionString: DIRECT_URL }); export const prisma = new PrismaClient({ adapter });
🧹 Nitpick comments (2)
content/800-guides/370-bun.mdx (2)
30-34: Use a consistent English variant (“Initialize” vs “initialise”).Mixing variants reads inconsistent. Docs elsewhere use US English.
-Then, initialise a new Bun project: +Then, initialize a new Bun project:Also applies to: 49-52
17-18: Minor grammar: “on your system”.-- [Bun](https://bun.sh/docs/installation) installed in your system +- [Bun](https://bun.sh/docs/installation) installed on your system
📜 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/370-bun.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/800-guides/370-bun.mdx
[grammar] ~17-~17: There might be a mistake here.
Context: ...s/installation) installed in your system - A Prisma Postgres database ...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...abase](/postgres) (created during setup) - Basic knowledge of JavaScript/TypeScript...
(QB_NEW_EN)
[uncategorized] ~49-~49: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...@prisma/adapter-pg dotenv ``` ### 2.2. Initialize Prisma ORM with Prisma Postgres Initia...
(EN_WORD_COHERENCY)
[uncategorized] ~50-~50: Do not mix variants of the same word (‘initialize’ and ‘initialise’) within a single text.
Context: ...ialize Prisma ORM with Prisma Postgres Initialize Prisma ORM with Prisma Postgres in your...
(EN_WORD_COHERENCY)
[grammar] ~65-~65: There might be a mistake here.
Context: ...directory with your schema.prisma file - A new Prisma Postgres database - A `.env...
(QB_NEW_EN)
[grammar] ~66-~66: There might be a mistake here.
Context: ...afile - A new Prisma Postgres database - A.envfile with yourDATABASE_URL` ...
(QB_NEW_EN)
[grammar] ~183-~183: There might be a mistake here.
Context: ...isma.$disconnect(); }); ``` ### 3.3. Create Prisma Config file to run the seed scri...
(QB_NEW_EN)
[style] ~298-~298: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ...message, and your application will work exactly the same as before. The executable includes all ...
(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)
[grammar] ~317-~317: There might be a mistake here.
Context: ...with additional models and relationships - Implementing authentication and authoriz...
(QB_NEW_EN)
[grammar] ~318-~318: There might be a mistake here.
Context: ...menting authentication and authorization - Adding input validation and error handli...
(QB_NEW_EN)
[grammar] ~319-~319: There might be a mistake here.
Context: ...ding input validation and error handling - Exploring Bun's built-in testing tools -...
(QB_NEW_EN)
[grammar] ~320-~320: There might be a mistake here.
Context: ...- Exploring Bun's built-in testing tools - Deploying your executable to production ...
(QB_NEW_EN)
[grammar] ~325-~325: There might be a mistake here.
Context: ...ers ### More info - Bun Documentation - [Prisma Driver Adapters](/orm/overview/da...
(QB_NEW_EN)
[grammar] ~326-~326: There might be a mistake here.
Context: ...//bun.sh/docs) - Prisma Driver Adapters - [Prisma Config File](/orm/reference/prism...
(QB_NEW_EN)
[grammar] ~327-~327: There might be a mistake here.
Context: .../database-drivers) - Prisma Config File - [Prisma Client without the Rust engine](/...
(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
* feat: add bun guide * Optimised images with calibre/image-actions * Optimised images with calibre/image-actions * Update content/800-guides/370-bun.mdx Co-authored-by: Nurul Sundarani <sundarani@prisma.io> * Optimised images with calibre/image-actions * fix: change image name * fix: numbering of thesections * fix: internal link --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nurul Sundarani <sundarani@prisma.io>
Summary by CodeRabbit
New Features
Documentation