Skip to content

fix import paths in getting started tutorials#7100

Merged
nikolasburk merged 3 commits intomainfrom
docs/fix-client-imports
Sep 4, 2025
Merged

fix import paths in getting started tutorials#7100
nikolasburk merged 3 commits intomainfrom
docs/fix-client-imports

Conversation

@nikolasburk
Copy link
Contributor

@nikolasburk nikolasburk commented Sep 4, 2025

Summary by CodeRabbit

  • Documentation
    • Updated TypeScript database querying guides (CockroachDB, MySQL, PlanetScale, PostgreSQL, SQL Server, MongoDB) to reference a locally generated Prisma Client; example usage and behavior unchanged.
    • Aligned Prisma Postgres CLI guide examples to the same import approach for consistency across setup instructions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Documentation TypeScript examples now import PrismaClient from a locally generated path (./generated/prisma) instead of @prisma/client across multiple guides; no other code, control flow, or error-handling changes were made.

Changes

Cohort / File(s) Summary
TS relational DB guides
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-...{cockroachdb,mysql,planetscale,postgresql,sqlserver}.mdx
Updated PrismaClient import source from @prisma/client to ./generated/prisma in snippets; no other modifications.
TS MongoDB guide
content/100-getting-started/02-setup-prisma/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
Updated PrismaClient import source from @prisma/client to ./generated/prisma; no other changes.
Prisma Postgres CLI doc
content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx
Replaced PrismaClient imports with ./generated/prisma across six code blocks; no logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • nurul3101
  • mhessdev
  • ankur-arch

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 92339dd and f19734a.

📒 Files selected for processing (1)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/fix-client-imports

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

original preview
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx

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 (3)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (1)

138-149: Type sample mismatches MongoDB (numeric ids)

MongoDB ids are strings/ObjectIds; the sample shows numbers. Correct the types to avoid confusing readers.

 export type Post = {
-  id: number
+  id: string
   title: string
   body: string | null
   published: boolean
-  authorId: number | null
+  authorId: string | null
 }
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx (1)

48-48: Update the explanatory bullet to match the new import path.

Readers will be confused by the reference to @prisma/client after switching the snippet to ./generated/prisma.

Apply:

-1. Import the `PrismaClient` constructor from the `@prisma/client` node module
+1. Import the `PrismaClient` constructor from the local module at `./generated/prisma`
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx (1)

48-48: Align the prose with the new import.

The bullet still points to @prisma/client; update to reflect ./generated/prisma.

Apply:

-1. Import the `PrismaClient` constructor from the `@prisma/client` node module
+1. Import the `PrismaClient` constructor from the local module at `./generated/prisma`
🧹 Nitpick comments (9)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (4)

24-42: Align code fence language with TypeScript

The snippet declares index.ts; use ts fence for correct highlighting/copy UX.

-```js file=index.ts copy
+```ts file=index.ts copy

46-52: Docs text still references @prisma/client

Update step 1 to match the new import path.

-1. Import the `PrismaClient` constructor from the `@prisma/client` node module
+1. Import the `PrismaClient` constructor from `./generated/prisma` (using a generator `output` of `./generated/prisma`)

75-76: MongoDB uses collections, not tables

Minor terminology fix.

-The `findMany` query you used in the previous section only _reads_ data from the database (although it was still empty). In this section, you'll learn how to write a query to _write_ new records into the `Post`, `User` and `Comment` tables.
+The `findMany` query you used in the previous section only _reads_ data from the database (although it was still empty). In this section, you'll learn how to write a query to _write_ new records into the `Post`, `User`, and `Comment` collections.

171-171: Grammar/wording tweak for clarity

“reference” → “references”; avoid “column” in MongoDB context.

-> **Note**: The unique identifier in the `authorId` document field on `Post` reference the `_id` document field in the `User` collection, meaning the `_id` value `60cc9b0e001e3bfd00a6eddf` column therefore refers to the first (and only) `User` record in the database.
+> **Note**: The unique identifier in the `authorId` document field on `Post` references the `_id` document field in the `User` collection, meaning the `_id` value `60cc9b0e001e3bfd00a6eddf` refers to the first (and only) `User` record in the database.
content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (2)

118-123: Call out the generator output explicitly (prevents confusion)

Since examples import from a local client path, add the generator block to the page to make it self-contained.

 Install the required dependencies to use Prisma Postgres:
 
 ```terminal
 npm install prisma --save-dev
 npm install @prisma/extension-accelerate

+Add the Prisma Client generator to your prisma/schema.prisma and direct the output to ./generated/prisma:
+
+```prisma file=prisma/schema.prisma
+generator client {

  • provider = "prisma-client-js"
  • output = "./generated/prisma"
    +}
    +```

---

`83-96`: **.gitignore suggestion for generated client directory**

To avoid committing build artifacts, suggest ignoring the generated client.


```diff
 Navigate into your project folder:
 
 ```terminal
 cd ./hello-prisma

Now that your project is in the correct location, continue with the setup.
+
+Add generated/ to your .gitignore to avoid committing the generated client:
+
+gitignore +generated/ +


</blockquote></details>
<details>
<summary>content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx (1)</summary><blockquote>

`47-52`: **Docs text still references @prisma/client**

Update step 1 to reflect the new import path.


```diff
-1. Import the `PrismaClient` constructor from the `@prisma/client` node module
+1. Import the `PrismaClient` constructor from `./generated/prisma` (generator `output` set to `./generated/prisma`)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx (1)

48-53: Docs text still references @prisma/client

Align the explanatory bullet with the updated import.

-1. Import the `PrismaClient` constructor from the `@prisma/client` node module
+1. Import the `PrismaClient` constructor from `./generated/prisma` (using a generator `output` of `./generated/prisma`)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx (1)

46-53: Docs text still references @prisma/client

Adjust the bullet to match the new import path.

-1. Import the `PrismaClient` constructor from the `@prisma/client` node module
+1. Import the `PrismaClient` constructor from `./generated/prisma` (with generator `output` set to `./generated/prisma`)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 4c57a71 and ccb4e4b.

📒 Files selected for processing (7)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-cockroachdb.mdx (1 hunks)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx (1 hunks)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx (1 hunks)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx (1 hunks)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx (1 hunks)
  • content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (1 hunks)
  • content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: runner / linkspector
  • GitHub Check: Check internal links
  • GitHub Check: Lost Pixel
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx (1)

25-25: Import path change looks good—verify generator output is configured

Using ./generated/prisma requires generator client output to point there. Please ensure the preceding “Install Prisma Client” page for MongoDB instructs:

generator client {
  provider = "prisma-client-js"
  output   = "./generated/prisma"
}
content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (1)

166-166: Import updates LGTM—ensure generator output matches

All updated imports to ./generated/prisma look consistent. Please confirm this guide (or a prerequisite page) tells users to set the generator output accordingly, otherwise imports will fail at runtime.

Also applies to: 193-193, 251-251, 305-305, 370-370

content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-postgresql.mdx (1)

26-26: Import path change looks good—verify generator output is configured

Ensure the corresponding “Install Prisma Client” step for PostgreSQL instructs setting output = "./generated/prisma" in the generator.

content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-planetscale.mdx (1)

27-27: Import path change looks good—verify generator output is configured

Confirm the PlanetScale “Install Prisma Client” page sets the generator output to ./generated/prisma.

content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-mysql.mdx (1)

27-27: Import path change looks good—verify generator output is configured

Please confirm the MySQL “Install Prisma Client” step instructs output = "./generated/prisma" in the generator block.

content/100-getting-started/02-setup-prisma/200-add-to-existing-project/110-relational-databases/250-querying-the-database-typescript-sqlserver.mdx (1)

27-27: Import path change looks good; verify generation and resolution.

Same as the CockroachDB page: confirm this guide (or a prerequisite) creates ./generated/prisma and that tsx resolves it without an extension.

You can reuse the grep script from the other comment to scan all getting-started pages.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 4, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 4, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 92339dd
Status: ✅  Deploy successful!
Preview URL: https://005eb496.docs-51g.pages.dev
Branch Preview URL: https://docs-fix-client-imports.docs-51g.pages.dev

View logs

…g-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 4, 2025
…g-project/120-mongodb/250-querying-the-database-typescript-mongodb.mdx
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