DR-7054- fix(docs): require driver adapter in PrismaClient setup examples#7504
DR-7054- fix(docs): require driver adapter in PrismaClient setup examples#7504ArthurGamby wants to merge 3 commits intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughDocumentation updates add and standardize Prisma driver adapter usage across examples (Postgres, MySQL/MariaDB, SQLite), extend installation instructions per database, add a Deno runtime guide, and include the Deno page in runtimes meta. Multiple code examples now construct adapters and pass them to PrismaClient instead of calling PrismaClient() directly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
🍈 Lychee Link Check Report3660 links: ❌ Errors
Full Statistics Table
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/docs/content/docs/orm/prisma-client/setup-and-configuration/introduction.mdx`:
- Around line 97-108: The MariaDB example currently hardcodes
host/user/database; update the PrismaMariaDb initialization to accept a
connection string from an environment variable instead (mirror the PostgreSQL
pattern), e.g. construct the adapter using process.env.DATABASE_URL or a
dedicated MYSQL_DATABASE_URL and pass that string into new PrismaMariaDb(...) so
the exported prisma = new PrismaClient({ adapter }) uses env-configured
credentials rather than hardcoded values; change the example to reference
process.env and keep the adapter/PrismaClient symbols as-is.
apps/docs/content/docs/orm/prisma-client/setup-and-configuration/introduction.mdx
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/docs/content/docs/guides/runtimes/deno.mdx (2)
109-124: Clarify the relationship between Prisma Postgres and the direct connection string.The guide title and description (Line 3) say "Prisma Postgres," step 2.1 uses
--dbto create a Prisma Postgres database, but then step 2.3 immediately switches to a direct connection string withadapter-pg. A newcomer might not understand why the initially generatedDATABASE_URLis being replaced. A sentence or two explaining that the driver adapter requires a direct TCP connection (rather than the Prisma Postgres proxy URL) would smooth over this transition.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/content/docs/guides/runtimes/deno.mdx` around lines 109 - 124, Add a brief clarifying sentence in the "2.3. Configure environment variables for direct connection" section explaining that the Prisma Postgres project dashboard provides a proxy-style DATABASE_URL by default but the adapter-pg driver requires a direct TCP connection string, so you must replace the generated DATABASE_URL with the direct connection string (the one starting with postgres://) before using adapter-pg; reference DATABASE_URL, adapter-pg, and "direct connection string" so readers understand why the replacement is necessary.
174-185: Duplicated adapter/client setup betweendb.tsandseed.ts.The adapter +
PrismaClientinstantiation is copy-pasted inseed.ts(Lines 192-201) instead of importing fromdb.ts. For a tutorial this is understandable since seed scripts run in a different context, but it's worth adding a brief note explaining why the setup is duplicated — otherwise readers may wonder why you don't justimport { prisma } from "../db.ts".Also applies to: 191-201
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/content/docs/guides/runtimes/deno.mdx` around lines 174 - 185, The guide currently shows duplicated adapter and PrismaClient setup in db.ts and seed.ts (PrismaPg, PrismaClient, prisma); update the docs to either import prisma from db.ts in seed.ts when possible or—if seed runs in a different Deno runtime/context—add a brief explanatory note next to the seed.ts snippet explaining why the adapter + PrismaClient instantiation is duplicated (e.g., seed scripts run in a separate process/environment so you cannot import ../db.ts), referencing the symbols PrismaPg, PrismaClient, and prisma so readers understand the duplication is intentional.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/docs/content/docs/guides/runtimes/deno.mdx`:
- Around line 1-5: The frontmatter in deno.mdx is missing required SEO fields;
add metaTitle and metaDescription to the existing frontmatter block (alongside
title/description/url) so they mirror sibling guides like bun.mdx — set
metaTitle to a concise page title (e.g., "Deno — Prisma ORM with Postgres") and
metaDescription to a short summary of the guide (e.g., "Learn how to use Prisma
ORM in a Deno application with Prisma Postgres"), ensuring keys are spelled
exactly as metaTitle and metaDescription.
---
Nitpick comments:
In `@apps/docs/content/docs/guides/runtimes/deno.mdx`:
- Around line 109-124: Add a brief clarifying sentence in the "2.3. Configure
environment variables for direct connection" section explaining that the Prisma
Postgres project dashboard provides a proxy-style DATABASE_URL by default but
the adapter-pg driver requires a direct TCP connection string, so you must
replace the generated DATABASE_URL with the direct connection string (the one
starting with postgres://) before using adapter-pg; reference DATABASE_URL,
adapter-pg, and "direct connection string" so readers understand why the
replacement is necessary.
- Around line 174-185: The guide currently shows duplicated adapter and
PrismaClient setup in db.ts and seed.ts (PrismaPg, PrismaClient, prisma); update
the docs to either import prisma from db.ts in seed.ts when possible or—if seed
runs in a different Deno runtime/context—add a brief explanatory note next to
the seed.ts snippet explaining why the adapter + PrismaClient instantiation is
duplicated (e.g., seed scripts run in a separate process/environment so you
cannot import ../db.ts), referencing the symbols PrismaPg, PrismaClient, and
prisma so readers understand the duplication is intentional.
| --- | ||
| title: Deno | ||
| description: Learn how to use Prisma ORM in a Deno application with Prisma Postgres | ||
| url: /guides/runtimes/deno | ||
| --- |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check frontmatter in sibling mdx files to understand the expected pattern
cd apps/docs/content/docs/guides/runtimes/
ls -la *.mdx 2>/dev/null | head -20
echo "---"
echo "Sample frontmatter from first 3 files:"
for file in *.mdx; do
echo "=== $file ==="
head -10 "$file"
doneRepository: prisma/web
Length of output: 1086
Add missing metaTitle and metaDescription to the frontmatter.
The deno.mdx file is missing required frontmatter fields that are present in sibling guides like bun.mdx. These fields are used for SEO and link metadata. Here's what needs to be added:
Fix
---
title: Deno
+metaTitle: How to use Prisma ORM and Prisma Postgres with Deno
description: Learn how to use Prisma ORM in a Deno application with Prisma Postgres
+metaDescription: Learn how to use Prisma ORM in a Deno application with Prisma Postgres
url: /guides/runtimes/deno
---📝 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.
| --- | |
| title: Deno | |
| description: Learn how to use Prisma ORM in a Deno application with Prisma Postgres | |
| url: /guides/runtimes/deno | |
| --- | |
| --- | |
| title: Deno | |
| metaTitle: How to use Prisma ORM and Prisma Postgres with Deno | |
| description: Learn how to use Prisma ORM in a Deno application with Prisma Postgres | |
| metaDescription: Learn how to use Prisma ORM in a Deno application with Prisma Postgres | |
| url: /guides/runtimes/deno | |
| --- |
🧰 Tools
🪛 GitHub Actions: Links
[error] 1-1: lint:links failed due to invalid frontmatter in deno.mdx. metaTitle and metaDescription must be strings; received undefined.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/docs/content/docs/guides/runtimes/deno.mdx` around lines 1 - 5, The
frontmatter in deno.mdx is missing required SEO fields; add metaTitle and
metaDescription to the existing frontmatter block (alongside
title/description/url) so they mirror sibling guides like bun.mdx — set
metaTitle to a concise page title (e.g., "Deno — Prisma ORM with Postgres") and
metaDescription to a short summary of the guide (e.g., "Learn how to use Prisma
ORM in a Deno application with Prisma Postgres"), ensuring keys are spelled
exactly as metaTitle and metaDescription.
This reverts commit c85b085.
Summary by CodeRabbit