Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include comments in prisma.schema file #248

Open
kato83 opened this issue Dec 13, 2024 · 0 comments
Open

Include comments in prisma.schema file #248

kato83 opened this issue Dec 13, 2024 · 0 comments

Comments

@kato83
Copy link

kato83 commented Dec 13, 2024

You can include comments on tables and columns in Prisma schema files.

Is it possible to add an option to output comments starting with “///” to the ER diagram?
Or do you plan to support it?

https://www.prisma.io/docs/orm/prisma-schema/overview#comments

  • // comment : This comment is for the reader's clarity and is not present in the abstract syntax tree (AST) of the schema.
  • /// comment : These comments will show up in the abstract syntax tree (AST) of the schema as descriptions to AST nodes.

The assumed tables and output ER diagrams are as follows.

Base schema.prisma

model Article {
  /// Primary key
  id    String @id
  /// Page title
  title String
  /// Page content
  body  String
}

Output mermaid

erDiagram
  "Article" {
    String id PK "Primary key"
    String title "Page title"
    String body "Page content"
  }
Loading

Thank you for the wonderful package.

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

No branches or pull requests

1 participant