Skip to content

Conversation

@csrs
Copy link

@csrs csrs commented Jan 25, 2026

Resolves #7455

In this code snippet https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7#after-1, the last line is missing the export keyword.

Currently:

import { PrismaClient } from './generated/prisma/client'; import { PrismaPg } from '@prisma/adapter-pg';

const adapter = new PrismaPg({ 
  connectionString: process.env.DATABASE_URL 
});
const prisma = new PrismaClient({ adapter });

Proposed change:

import { PrismaClient } from './generated/prisma/client'; import { PrismaPg } from '@prisma/adapter-pg';

const adapter = new PrismaPg({ 
  connectionString: process.env.DATABASE_URL 
});
export const prisma = new PrismaClient({ adapter });

Summary by CodeRabbit

  • Documentation
    • Updated Prisma 7 upgrade guide with corrected code examples demonstrating the recommended approach for client instantiation and configuration.

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

Resolves prisma#7455

In this code snippet https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7#after-1, the last line is missing the export keyword.

Currently:

import { PrismaClient } from './generated/prisma/client';
import { PrismaPg } from '@prisma/adapter-pg';

const adapter = new PrismaPg({ 
  connectionString: process.env.DATABASE_URL 
});
const prisma = new PrismaClient({ adapter });
Proposed change:

import { PrismaClient } from './generated/prisma/client';
import { PrismaPg } from '@prisma/adapter-pg';

const adapter = new PrismaPg({ 
  connectionString: process.env.DATABASE_URL 
});
export const prisma = new PrismaClient({ adapter });
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Walkthrough

This pull request corrects a code example in the Prisma 7 upgrade documentation by adding the export keyword to a PrismaClient instantiation. The change ensures the code snippet demonstrates the proper pattern for exporting the prisma instance, making it accessible to other modules as per best practices.

Changes

Cohort / File(s) Summary
Documentation Update
content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx
Added export keyword to PrismaClient instantiation in code example: const prisma = ...export const prisma = ... to match recommended pattern

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly references the issue and clearly describes the main change: adding the 'export' keyword to a code snippet in documentation.
Linked Issues check ✅ Passed The code change adds the 'export' keyword to the Prisma client instantiation, exactly matching the requirement in issue #7455 to export the prisma instance.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to the single file and modification requested in issue #7455 with no extraneous modifications.
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.


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.

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.

Example code in "Upgrade to Prisma 7" missing "export" keyword

1 participant