Skip to content

Conversation

@alexspearsi
Copy link

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

Walkthrough

Prisma PostgreSQL guide updated to use the Postgres adapter (@prisma/adapter-pg) instead of the accelerate extension: install step, imports, client initialization, and export adjusted; DATABASE_URL removed from the Prisma datasource block; client exported as a named prisma using PrismaPg with a connection string.

Changes

Cohort / File(s) Change Summary
Prisma PostgreSQL Guide
docs/guides/ecosystem/prisma-postgres.mdx
Install step now adds @prisma/adapter-pg. Removed url (DATABASE_URL) from the datasource block. Imports updated (added PrismaPg from @prisma/adapter-pg, adjusted client import). Replaced new PrismaClient().$extends(withAccelerate()) with const adapter = new PrismaPg({ connectionString }) and const prisma = new PrismaClient({ adapter }). Export changed to export { prisma }.

Pre-merge checks

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates the main change: updating the Prisma Bun + Postgres guide to version 7.2.0, which aligns with the documentation updates shown in the file summary.
Description check ✅ Passed The description covers both required template sections: explaining what the PR does (updating Prisma guide to v7.2.0) and how changes were verified (following steps, running migrations, testing queries).

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
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

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 db block is missing the required url configuration. Without this, Prisma cannot connect to the database, and commands like prisma migrate and prisma generate will 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 7906703 and 8178fc4.

📒 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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 missing url field to the datasource block.

The datasource block is missing the required url field. Even when using the Postgres adapter (@prisma/adapter-pg) for runtime connections, Prisma CLI commands like prisma migrate and prisma generate still require the url field 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 8178fc4 and dac2442.

📒 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-pg instead 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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 required url field to the datasource block.

The datasource block is missing the url field, 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 migrate and prisma generate commands 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.

📥 Commits

Reviewing files that changed from the base of the PR and between dac2442 and e7a97b9.

📒 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-pg for the Postgres adapter approach. The previously flagged @prisma/extension-accelerate has 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-pg and 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

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.

1 participant