Skip to content

Conversation

@smith558
Copy link

@smith558 smith558 commented Jan 25, 2026

Fixes outdated instructions to be in line with recent changes (https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7#driver-adapters-and-client-instantiation).

Closes prisma/prisma#28670

Summary by CodeRabbit

  • Documentation
    • Updated Prisma Client setup documentation to include PostgreSQL adapter configuration
    • Added installation instructions for the PostgreSQL adapter package
    • Updated code examples demonstrating PrismaClient initialization with the PostgreSQL adapter in TypeScript and CommonJS

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Walkthrough

Documentation update to Prisma Client initialization guidance, adding installation and usage of the PostgreSQL adapter package (@prisma/adapter-pg) alongside standard Prisma packages in code examples.

Changes

Cohort / File(s) Change Summary
PostgreSQL Adapter Integration
content/200-orm/050-overview/100-introduction/100-what-is-prisma.mdx
Adds @prisma/adapter-pg to installation steps; updates PrismaClient initialization examples in TypeScript and CommonJS to instantiate PrismaPg adapter and pass it via PrismaClient({ adapter }) parameter.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'docs: Fix outdated instructions' is vague and generic, using the non-descriptive term 'outdated instructions' without specifying what aspect of the documentation is being updated. Make the title more specific by mentioning the key change, such as 'docs: Update Prisma Client initialization examples to use PostgreSQL adapter' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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


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

🤖 Fix all issues with AI agents
In `@content/200-orm/050-overview/100-introduction/100-what-is-prisma.mdx`:
- Around line 185-190: The example passes process.env.DATABASE_URL directly to
PrismaPg and can fail TypeScript checks because process.env.DATABASE_URL is
string | undefined; define a connectionString constant (e.g., const
connectionString = `${process.env.DATABASE_URL}`) and pass that to new
PrismaPg(...) and to new PrismaClient(...) where the adapter is set so the types
are satisfied and the docs remain consistent; update both occurrences around the
PrismaPg/PrismaClient examples to use the connectionString constant instead of
process.env.DATABASE_URL directly.

Comment on lines 185 to 190
import { PrismaClient } from './generated/client'
import { PrismaPg } from '@prisma/adapter-pg';

const prisma = new PrismaClient()
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
const prisma = new PrismaClient({ adapter })
```
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

Use a connectionString constant to keep TS types happy and align doc conventions.

process.env.DATABASE_URL is string | undefined in TS, so the current example can fail type-checking. Defining a connectionString constant (with a template literal) both satisfies TS and keeps adapter examples consistent across docs. Based on learnings, ...

🔧 Suggested update for both tabs
-import { PrismaPg } from '@prisma/adapter-pg';
-
-const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });
+import { PrismaPg } from '@prisma/adapter-pg'
+
+const connectionString = `${process.env.DATABASE_URL}`
+const adapter = new PrismaPg({ connectionString })
 const prisma = new PrismaClient({ adapter })
-const { PrismaPg } = require('@prisma/adapter-pg')
-
-const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
+const { PrismaPg } = require('@prisma/adapter-pg')
+
+const connectionString = `${process.env.DATABASE_URL}`
+const adapter = new PrismaPg({ connectionString })
 const prisma = new PrismaClient({ adapter })
PrismaPg adapter connectionString TypeScript example Prisma docs

Also applies to: 196-200

🤖 Prompt for AI Agents
In `@content/200-orm/050-overview/100-introduction/100-what-is-prisma.mdx` around
lines 185 - 190, The example passes process.env.DATABASE_URL directly to
PrismaPg and can fail TypeScript checks because process.env.DATABASE_URL is
string | undefined; define a connectionString constant (e.g., const
connectionString = `${process.env.DATABASE_URL}`) and pass that to new
PrismaPg(...) and to new PrismaClient(...) where the adapter is set so the types
are satisfied and the docs remain consistent; update both occurrences around the
PrismaPg/PrismaClient examples to use the connectionString constant instead of
process.env.DATABASE_URL directly.

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.

Prisma 7: PrismaClient fails to instantiate in ESM environment (TypeError: __internal undefined)

1 participant