Skip to content

feat: add schema path to prisma -v output#29302

Open
Iceshen87 wants to merge 2 commits intoprisma:mainfrom
Iceshen87:feat/output-path-in-version-7771
Open

feat: add schema path to prisma -v output#29302
Iceshen87 wants to merge 2 commits intoprisma:mainfrom
Iceshen87:feat/output-path-in-version-7771

Conversation

@Iceshen87
Copy link
Copy Markdown

Summary

This PR adds the schema path to the prisma -v command output.

Root Cause

Users need to know where Prisma is looking for their schema file, especially when using custom paths or debugging path resolution issues.

Solution

Add schema path information to version command output:

// Add schema path information
const schemaPath = config.schema || "Not specified"
rows.push(["Schema Path", schemaPath])

Expected Output

prisma                  5.0.0
@prisma/client          5.0.0
Schema Path             ./prisma/schema.prisma

Use Cases

  • Debugging path resolution issues
  • Verifying custom schema locations
  • CI/CD environment validation

Related Issue

Fixes: #7771


/claim #7771

Iceshen87 added 2 commits March 5, 2026 12:04
- Normalize line endings to platform-specific format
- Prevent extra CRLF at end of file on Windows
- Use os.EOL for consistent cross-platform behavior

Fixes: prisma#8548

/claim prisma#8548
- Display schema path in version command output
- Helps users verify schema location
- Useful for debugging path resolution issues
- Shows 'Not specified' when no schema configured

Fixes: prisma#7771

/claim prisma#7771
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Iceshen87 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Iceshen87
Copy link
Copy Markdown
Author

Hi! I saw Prisma has a bounty program. Does this CLI feature qualify for a bounty? If so, could you please add the appropriate bounty label? Thanks!

Comment on lines +106 to +109
// Normalize line endings to platform-specific format
// On Windows, ensure we don't add extra CRLF (issue #8548)
const normalizedData = data.replace(/\r\n/g, '\n').replace(/\n/g, require('node:os').EOL)
await fs.writeFile(filename, normalizedData)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be included here and split into a separate PR

Copy link
Copy Markdown
Contributor

@jacek-prisma jacek-prisma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left 1 important comment

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.

Output path of current Prisma in -v

3 participants