pantharshit00 / prisma-docs-generator

Prisma generator for automatically generating documentation reference from the Prisma schema.
MIT License
578 stars 27 forks source link

Can I use comments in `schema.prisma` #56

Closed valerii15298 closed 1 year ago

valerii15298 commented 2 years ago

Is it possible use comments from schema.prisma in generated docs? For example when I will add comment to model or to a field.

Hitlii commented 1 year ago

Yes is possible, you just add comments after ///

So if you want a model description just add /// before the model description

If you want a field comment, add /// before the field

/// Esta es una descripcion del modelo model Paises { /// Esto es algo que agregue yo id Int @id @default(autoincrement()) pais String abreviacion String createdAt DateTime @default(now()) @db.Timestamptz @map("created_at") updatedAt DateTime @updatedAt @db.Timestamptz @map("updated_at") @@map("paises") @@unique([pais,abreviacion]) }

image

Would be nice that we also could put some markdown