tem algo errado no passo 7#7932
Conversation
resolvi aprender somente na documentação,porém o código do passo 7 deu erro,fui pesquisar isso e descobri que O erro de tipos acontece porque process.env.DATABASE_HOST retorna string | undefined no TypeScript, mas o construtor do PrismaMariaDb espera string — sem o undefined. só coloquei os ! para ficar como not undefined
|
@RAUNIFCE is attempting to deploy a commit to the Prisma Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThis PR updates the MySQL quickstart documentation to demonstrate proper type-safe environment variable handling. The code example in ChangesMySQL Quickstart Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/content/docs/`(index)/prisma-orm/quickstart/mysql.mdx:
- Around line 206-209: The quickstart MySQL example uses non-null assertions
like process.env.DATABASE_HOST!, process.env.DATABASE_USER!,
process.env.DATABASE_PASSWORD!, process.env.DATABASE_NAME! while the other guide
omits the `!`; make them consistent by removing the trailing `!` in the
quickstart example (adjust the PrismaMariaDb adapter config values to use
process.env.DATABASE_HOST, process.env.DATABASE_USER,
process.env.DATABASE_PASSWORD, process.env.DATABASE_NAME without the non-null
assertion).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7cc9660a-c0e0-4498-8a12-e80ae1eb78b0
📒 Files selected for processing (1)
apps/docs/content/docs/(index)/prisma-orm/quickstart/mysql.mdx
| host: process.env.DATABASE_HOST!, | ||
| user: process.env.DATABASE_USER!, | ||
| password: process.env.DATABASE_PASSWORD!, | ||
| database: process.env.DATABASE_NAME!, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check if the add-to-existing-project guide has the same pattern
# Search for PrismaMariaDb configuration in the add-to-existing-project guide
rg -A 10 'new PrismaMariaDb\(' apps/docs/content/docs/\(index\)/prisma-orm/add-to-existing-project/mysql.mdxRepository: prisma/web
Length of output: 340
Align env var non-null assertions across the MySQL Prisma docs examples
In quickstart/mysql.mdx, the PrismaMariaDb adapter uses process.env.DATABASE_HOST!/! for the env vars, but the corresponding example in add-to-existing-project/mysql.mdx uses process.env.DATABASE_HOST (no !). Update one side so both guides present the same TypeScript pattern.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/docs/content/docs/`(index)/prisma-orm/quickstart/mysql.mdx around lines
206 - 209, The quickstart MySQL example uses non-null assertions like
process.env.DATABASE_HOST!, process.env.DATABASE_USER!,
process.env.DATABASE_PASSWORD!, process.env.DATABASE_NAME! while the other guide
omits the `!`; make them consistent by removing the trailing `!` in the
quickstart example (adjust the PrismaMariaDb adapter config values to use
process.env.DATABASE_HOST, process.env.DATABASE_USER,
process.env.DATABASE_PASSWORD, process.env.DATABASE_NAME without the non-null
assertion).
resolvi aprender somente na documentação,porém o código do passo 7 deu erro,fui pesquisar isso e descobri que O erro de tipos acontece porque process.env.DATABASE_HOST retorna string | undefined no TypeScript, mas o construtor do PrismaMariaDb espera string — sem o undefined. só coloquei os ! para ficar como not undefined
Summary by CodeRabbit