-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Update Prisma Bun + Postgres (Prisma 7.2.0) #25678
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughPrisma PostgreSQL guide updated to use the Postgres adapter ( Changes
Pre-merge checks✅ Passed checks (2 passed)
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. Comment |
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/guides/ecosystem/prisma-postgres.mdx (2)
49-51: Critical: Missing database URL configuration in datasource block.The
datasource dbblock is missing the requiredurlconfiguration. Without this, Prisma cannot connect to the database, and commands likeprisma migrateandprisma generatewill fail.🔎 Proposed fix
datasource db { provider = "postgresql" + url = env("DATABASE_URL") }
105-105: Update the step title to reflect current implementation.The step title mentions "Initialize Prisma Client with Accelerate", but the implementation no longer uses the Accelerate extension. It now uses the Postgres adapter instead.
🔎 Proposed fix
- <Step title="Initialize Prisma Client with Accelerate"> + <Step title="Initialize Prisma Client with Postgres Adapter">
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/guides/ecosystem/prisma-postgres.mdx
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: cirospaciari
Repo: oven-sh/bun PR: 22946
File: test/js/sql/sql.test.ts:195-202
Timestamp: 2025-09-25T22:07:13.851Z
Learning: PR oven-sh/bun#22946: JSON/JSONB result parsing updates (e.g., returning parsed arrays instead of legacy strings) are out of scope for this PR; tests keep current expectations with a TODO. Handle parsing fixes in a separate PR.
Learnt from: AmanVarshney01
Repo: oven-sh/bun PR: 23580
File: docs/guides/ecosystem/prisma.md:21-26
Timestamp: 2025-10-15T04:01:16.478Z
Learning: For Prisma with Bun runtime and Rust-free client (engineType "client"), when using local SQLite files (file:// URLs), use either prisma/adapter-better-sqlite3 or the Bun-native synapsenwerkstatt/prisma-bun-sqlite-adapter. The prisma/adapter-libsql adapter is only for remote libSQL/Turso endpoints and will not work with local SQLite file URLs.
📚 Learning: 2025-10-15T04:01:16.478Z
Learnt from: AmanVarshney01
Repo: oven-sh/bun PR: 23580
File: docs/guides/ecosystem/prisma.md:21-26
Timestamp: 2025-10-15T04:01:16.478Z
Learning: For Prisma with Bun runtime and Rust-free client (engineType "client"), when using local SQLite files (file:// URLs), use either prisma/adapter-better-sqlite3 or the Bun-native synapsenwerkstatt/prisma-bun-sqlite-adapter. The prisma/adapter-libsql adapter is only for remote libSQL/Turso endpoints and will not work with local SQLite file URLs.
Applied to files:
docs/guides/ecosystem/prisma-postgres.mdx
📚 Learning: 2025-11-24T18:37:11.466Z
Learnt from: CR
Repo: oven-sh/bun PR: 0
File: src/js/CLAUDE.md:0-0
Timestamp: 2025-11-24T18:37:11.466Z
Learning: Write JS builtins for Bun's Node.js compatibility and APIs, and run `bun bd` after changes
Applied to files:
docs/guides/ecosystem/prisma-postgres.mdx
🔇 Additional comments (1)
docs/guides/ecosystem/prisma-postgres.mdx (1)
109-117: Cannot verify the import path claim without accessing the actual schema configuration.The import path depends on the generator.output configuration in
prisma/schema.prisma, but that file is not found in this repository. While the Prisma 7.2.0 adapter setup approach is correct (adapter-pg with PrismaClient initialization), the specific import path"../generated/prisma/client"validity cannot be confirmed without knowing the actual schema output configuration. If the schema's generator output is configured at the root level (rather than inside the prisma directory), the path shown would be correct.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/guides/ecosystem/prisma-postgres.mdx (1)
49-51: Add missingurlfield to the datasource block.The datasource block is missing the required
urlfield. Even when using the Postgres adapter (@prisma/adapter-pg) for runtime connections, Prisma CLI commands likeprisma migrateandprisma generatestill require theurlfield in the schema. Without it, the migrations shown in lines 75-76 will fail.🔎 Proposed fix
datasource db { provider = "postgresql" + url = env("DATABASE_URL") }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/guides/ecosystem/prisma-postgres.mdx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: cirospaciari
Repo: oven-sh/bun PR: 22946
File: test/js/sql/sql.test.ts:195-202
Timestamp: 2025-09-25T22:07:13.851Z
Learning: PR oven-sh/bun#22946: JSON/JSONB result parsing updates (e.g., returning parsed arrays instead of legacy strings) are out of scope for this PR; tests keep current expectations with a TODO. Handle parsing fixes in a separate PR.
Learnt from: AmanVarshney01
Repo: oven-sh/bun PR: 23580
File: docs/guides/ecosystem/prisma.md:21-26
Timestamp: 2025-10-15T04:01:16.478Z
Learning: For Prisma with Bun runtime and Rust-free client (engineType "client"), when using local SQLite files (file:// URLs), use either prisma/adapter-better-sqlite3 or the Bun-native synapsenwerkstatt/prisma-bun-sqlite-adapter. The prisma/adapter-libsql adapter is only for remote libSQL/Turso endpoints and will not work with local SQLite file URLs.
📚 Learning: 2025-10-15T04:01:16.478Z
Learnt from: AmanVarshney01
Repo: oven-sh/bun PR: 23580
File: docs/guides/ecosystem/prisma.md:21-26
Timestamp: 2025-10-15T04:01:16.478Z
Learning: For Prisma with Bun runtime and Rust-free client (engineType "client"), when using local SQLite files (file:// URLs), use either prisma/adapter-better-sqlite3 or the Bun-native synapsenwerkstatt/prisma-bun-sqlite-adapter. The prisma/adapter-libsql adapter is only for remote libSQL/Turso endpoints and will not work with local SQLite file URLs.
Applied to files:
docs/guides/ecosystem/prisma-postgres.mdx
🔇 Additional comments (2)
docs/guides/ecosystem/prisma-postgres.mdx (2)
24-28: LGTM! Installation updated correctly.The installation steps have been properly updated to include
@prisma/adapter-pginstead of@prisma/extension-accelerate, which aligns with the Prisma 7.2.0 workflow for direct Postgres connections.
105-105: LGTM! Step title accurately reflects the implementation.The step title has been correctly updated to reference the Postgres adapter instead of Accelerate, matching the actual implementation.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/guides/ecosystem/prisma-postgres.mdx (1)
49-51: Add the requiredurlfield to the datasource block.The datasource block is missing the
urlfield, which is required for Prisma CLI commands and schema validation. Even when using @prisma/adapter-pg for runtime client initialization, the schema must define the datasource URL.Without this field, the
prisma migrateandprisma generatecommands in steps 5–6 will fail.datasource db { provider = "postgresql" + url = env("DATABASE_URL") }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/guides/ecosystem/prisma-postgres.mdx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: cirospaciari
Repo: oven-sh/bun PR: 22946
File: test/js/sql/sql.test.ts:195-202
Timestamp: 2025-09-25T22:07:13.851Z
Learning: PR oven-sh/bun#22946: JSON/JSONB result parsing updates (e.g., returning parsed arrays instead of legacy strings) are out of scope for this PR; tests keep current expectations with a TODO. Handle parsing fixes in a separate PR.
Learnt from: AmanVarshney01
Repo: oven-sh/bun PR: 23580
File: docs/guides/ecosystem/prisma.md:21-26
Timestamp: 2025-10-15T04:01:16.478Z
Learning: For Prisma with Bun runtime and Rust-free client (engineType "client"), when using local SQLite files (file:// URLs), use either prisma/adapter-better-sqlite3 or the Bun-native synapsenwerkstatt/prisma-bun-sqlite-adapter. The prisma/adapter-libsql adapter is only for remote libSQL/Turso endpoints and will not work with local SQLite file URLs.
📚 Learning: 2025-10-15T04:01:16.478Z
Learnt from: AmanVarshney01
Repo: oven-sh/bun PR: 23580
File: docs/guides/ecosystem/prisma.md:21-26
Timestamp: 2025-10-15T04:01:16.478Z
Learning: For Prisma with Bun runtime and Rust-free client (engineType "client"), when using local SQLite files (file:// URLs), use either prisma/adapter-better-sqlite3 or the Bun-native synapsenwerkstatt/prisma-bun-sqlite-adapter. The prisma/adapter-libsql adapter is only for remote libSQL/Turso endpoints and will not work with local SQLite file URLs.
Applied to files:
docs/guides/ecosystem/prisma-postgres.mdx
🔇 Additional comments (2)
docs/guides/ecosystem/prisma-postgres.mdx (2)
28-28: LGTM!The installation command correctly includes
@prisma/adapter-pgfor the Postgres adapter approach. The previously flagged@prisma/extension-acceleratehas been properly removed.
105-117: LGTM!The Prisma Client initialization correctly uses the Postgres adapter pattern for Prisma 7.2.0:
- Proper imports from
@prisma/adapter-pgand the generated client- Adapter instantiated with the connection string
- Client correctly initialized with the adapter
- Clean named export pattern
The import path fix from the previous review has been properly applied.
|
|
||
| <Step title="Install Prisma dependencies"> | ||
| Then install the Prisma CLI (`prisma`), Prisma Client (`@prisma/client`), and the accelerate extension as dependencies. | ||
| Then install the Prisma CLI (`prisma`), Prisma Client (`@prisma/client`), and the adapter-pg extension as dependencies. |
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.
Fix terminology: adapter-pg is an adapter, not an extension.
The description refers to @prisma/adapter-pg as an "extension," but it's actually a database driver adapter. Prisma extensions refer to client extensions (like withAccelerate()), while adapters provide custom database drivers.
🔎 Proposed fix
- Then install the Prisma CLI (`prisma`), Prisma Client (`@prisma/client`), and the adapter-pg extension as dependencies.
+ Then install the Prisma CLI (`prisma`), Prisma Client (`@prisma/client`), and the Postgres adapter as dependencies.📝 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.
| Then install the Prisma CLI (`prisma`), Prisma Client (`@prisma/client`), and the adapter-pg extension as dependencies. | |
| Then install the Prisma CLI (`prisma`), Prisma Client (`@prisma/client`), and the Postgres adapter as dependencies. |
🤖 Prompt for AI Agents
In docs/guides/ecosystem/prisma-postgres.mdx around line 24, the sentence calls
@prisma/adapter-pg an "extension" but it is a database driver adapter; update
the wording to call it an "adapter" or "database adapter/driver" instead of
"extension" and adjust surrounding text to avoid conflating with Prisma Client
extensions so the doc correctly distinguishes adapter vs extension terminology.
What does this PR do?
It updates the Bun and Postgres Prisma guide and replaces the old setup with the current Prisma (v. 7.2.0) approach
How did you verify your code works?
I followed the updated steps I ran migrations and I tested basic queries