Skip to content

docs(prisma): update integration for Prisma v7#826

Merged
SaltyAom merged 4 commits into
elysiajs:mainfrom
Leopc1977:docs/update-prisma-v7
Apr 4, 2026
Merged

docs(prisma): update integration for Prisma v7#826
SaltyAom merged 4 commits into
elysiajs:mainfrom
Leopc1977:docs/update-prisma-v7

Conversation

@Leopc1977
Copy link
Copy Markdown
Contributor

@Leopc1977 Leopc1977 commented Apr 3, 2026

Hey, just updated the Prisma integration to v7
For reference: https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7

Summary by CodeRabbit

  • Documentation
    • Updated Prisma integration guide: added Bun SQLite adapter installation and setup, clarified Prisma 7+ URL/adapter-driven runtime URL behavior, and revised the example to demonstrate creating and exporting a client configured with an adapter.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 3, 2026

Warning

Rate limit exceeded

@Leopc1977 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 1 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 12 minutes and 1 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7eac6395-3db1-457b-8026-822c2d1efd16

📥 Commits

Reviewing files that changed from the base of the PR and between 029cc9c and 754e7b5.

📒 Files selected for processing (1)
  • docs/integrations/prisma.md

Walkthrough

Updated the Prisma integration docs to install prisma-adapter-bun-sqlite, remove the url = env("DATABASE_URL") datasource line, and export a PrismaClient instance created with a PrismaBunSqlite adapter (using process.env.DATABASE_URL or file:./dev.db fallback).

Changes

Cohort / File(s) Summary
Prisma Adapter Migration
docs/integrations/prisma.md
Added prisma-adapter-bun-sqlite install step, removed datasource db url = env("DATABASE_URL") note for Prisma 7+ adapter-driven URLs, changed example to construct PrismaBunSqlite with process.env.DATABASE_URL ?? "file:./dev.db" and export const prisma = new PrismaClient({ adapter }).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Docs got an adapter, neat and spry~ (you could've done it sooner, baka~) (⌒‿⌒)♡
Prisma now wears Bun SQLite like a hat~ (so chic~) (≧◡≦)♡
Export the client, wire the adapter, run fast~ (try to keep up~) (^▽^)♡

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(prisma): update integration for Prisma v7' directly and clearly summarizes the main change in the changeset—updating Prisma integration documentation for version 7 compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/integrations/prisma.md (1)

118-123: Avoid silent production fallback for DATABASE_URL; fail fast or gate by env.
Right now missing env quietly drops to file:./dev.db, which is cute in dev but nasty in prod, baka~ (¬、¬)♡ Recommend dev-only fallback with explicit failure otherwise.

Suggested safer example
-import { PrismaBunSqlite } from 'prisma-adapter-bun-sqlite';
+import { PrismaLibSql } from '@prisma/adapter-libsql';
 import { PrismaClient } from '../generated/prisma/client' // [!code ++]

-const adapter = new PrismaBunSqlite({ url: process.env.DATABASE_URL || "file:./dev.db" });
+const url =
+  process.env.DATABASE_URL ??
+  (process.env.NODE_ENV === 'development' ? 'file:./dev.db' : undefined)
+
+if (!url) throw new Error('DATABASE_URL is required outside development')
+
+const adapter = new PrismaLibSql({ url });
 export const prisma = new PrismaClient({ adapter });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/integrations/prisma.md` around lines 118 - 123, The current
PrismaBunSqlite initialization silently falls back to "file:./dev.db" when
process.env.DATABASE_URL is missing; change this to fail fast in non-development
environments by validating process.env.DATABASE_URL before creating new
PrismaBunSqlite. Update the code around PrismaBunSqlite and prisma: if NODE_ENV
=== 'development' allow the dev-file fallback, otherwise throw an explicit error
or stop startup when DATABASE_URL is undefined/empty so PrismaClient (exported
as prisma) is never initialized with a hidden production fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/integrations/prisma.md`:
- Around line 72-73: Update the Prisma v7 note to cover both locations where the
datasource URL belongs: describe that CLI and migration tooling read the URL
from prisma.config.ts (mention prisma.config.ts and the datasource block) and
that runtime code uses the adapter passed into the PrismaClient constructor
(mention PrismaClient and the adapter/setup used at runtime); clarify which one
to update for migrations vs runtime, and include a short example description
pointing readers to set the URL in prisma.config.ts for CLI tasks and to supply
the adapter/connection when instantiating PrismaClient at runtime.

---

Nitpick comments:
In `@docs/integrations/prisma.md`:
- Around line 118-123: The current PrismaBunSqlite initialization silently falls
back to "file:./dev.db" when process.env.DATABASE_URL is missing; change this to
fail fast in non-development environments by validating process.env.DATABASE_URL
before creating new PrismaBunSqlite. Update the code around PrismaBunSqlite and
prisma: if NODE_ENV === 'development' allow the dev-file fallback, otherwise
throw an explicit error or stop startup when DATABASE_URL is undefined/empty so
PrismaClient (exported as prisma) is never initialized with a hidden production
fallback.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a21a8704-ccc8-404f-bf6d-004f1e598c9e

📥 Commits

Reviewing files that changed from the base of the PR and between e14abd7 and ebf6a29.

📒 Files selected for processing (1)
  • docs/integrations/prisma.md

Comment thread docs/integrations/prisma.md Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/integrations/prisma.md (1)

53-124: Soooo, about that Prisma v7 migration~ ヾ(≧▽≦)o*

You're updating the docs but kinda forgot to mention some important stuff? Like:

  1. Where's the link to the upgrade guide? Your PR description references it (https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7) but you don't include it in the docs for your users. That's pretty unhelpful~ ♡

  2. What about prisma generate? After setting all this up, users need to run it with the new config. You should probably mention that somewhere? (。•́‿•̀。)

  3. Is prismabox even compatible with v7? You're updating Prisma but not checking if the generator works with it. That could break everything beautifully~ (◠‿◠)

💡 Suggested improvements for complete v7 migration guide

Add a "Migration from Prisma v6" section or "Important notes" callout:

::: tip Upgrading from Prisma 6
When upgrading from Prisma 6 to 7:
1. Create a `prisma.config.ts` file at your project root (see configuration above)
2. Install the driver adapter: `bun add [correct-adapter-package]`
3. Update your schema.prisma to remove the `url` from datasource
4. Run `bunx prisma generate` to regenerate the client
5. Update your application code to use the adapter (see example above)

For more details, see the [official Prisma v7 upgrade guide](https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7).
:::
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/integrations/prisma.md` around lines 53 - 124, The docs update misses
Prisma v7 migration steps and compatibility notes: add a short "Upgrading to
Prisma v7" or "Important notes" section that links to the official guide
(https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7), instructs users to
create prisma.config.ts and remove the datasource url from prisma/schema.prisma,
tells them to install the appropriate driver adapter (e.g. the package used with
PrismaBunSqlite) and run the generator (e.g. bunx prisma generate) after
updating schema, and include a compatibility note about the prismabox generator
(or pin/validate the supported prismabox version) so users know whether
prismabox + typebox import settings will work with Prisma v7 and PrismaClient
usage in your example.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/integrations/prisma.md`:
- Around line 72-73: Add a new section showing how to create a prisma.config.ts
at the project root and include a minimal example using defineConfig that points
schema to 'prisma/schema.prisma' and sets a datasource.url (e.g.,
process.env.DATABASE_URL with a fallback like 'file:./dev.db'); explain that
this file is required for Prisma CLI commands (prisma migrate dev, prisma db
push) in Prisma 7+ and reference the symbols prisma.config.ts, defineConfig,
schema, and datasource.url so readers can copy the exact setup.
- Line 53: Update the package install line that lists
"prisma-adapter-bun-sqlite" to clarify that prisma-adapter-bun-sqlite is a
community-maintained adapter (not an official `@prisma` package), mention its
version/stability (e.g., v0.7.1, production-ready) and zero-deps note, and add a
short recommendation to use the official alternative "@prisma/adapter-libsql" if
you prefer an official Prisma-supported adapter (noting that it requires a
libSQL server); ensure the text references the package names
"prisma-adapter-bun-sqlite" and "@prisma/adapter-libsql" so readers can find
them.

---

Nitpick comments:
In `@docs/integrations/prisma.md`:
- Around line 53-124: The docs update misses Prisma v7 migration steps and
compatibility notes: add a short "Upgrading to Prisma v7" or "Important notes"
section that links to the official guide
(https://www.prisma.io/docs/guides/upgrade-prisma-orm/v7), instructs users to
create prisma.config.ts and remove the datasource url from prisma/schema.prisma,
tells them to install the appropriate driver adapter (e.g. the package used with
PrismaBunSqlite) and run the generator (e.g. bunx prisma generate) after
updating schema, and include a compatibility note about the prismabox generator
(or pin/validate the supported prismabox version) so users know whether
prismabox + typebox import settings will work with Prisma v7 and PrismaClient
usage in your example.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2a35b590-d332-45a0-8c0a-03b976651aa7

📥 Commits

Reviewing files that changed from the base of the PR and between ebf6a29 and 029cc9c.

📒 Files selected for processing (1)
  • docs/integrations/prisma.md

Comment thread docs/integrations/prisma.md
Comment thread docs/integrations/prisma.md
@SaltyAom SaltyAom merged commit a0b8c34 into elysiajs:main Apr 4, 2026
1 check passed
@Leopc1977 Leopc1977 deleted the docs/update-prisma-v7 branch April 10, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants