/prisma-erd-generator

Generate an ER Diagram based on your Prisma schema every time you run npx prisma generate

Primary LanguageTypeScriptMIT LicenseMIT

Prisma Entity Relationship Diagram Generator

Prisma generator to create an ER Diagram every time you generate your prisma client.

Like this tool? @Skn0tt started this effort with his web app ER diagram generator

npm i -D prisma-erd-generator
# or
yarn add -D prisma-erd-generator

Add to your schema.prisma

generator erd {
  provider = "prisma-erd-generator"
}

Run the generator

npx prisma generate

Example ER Diagram

Options

Additional configuration

Output

Change output type and location

Usage

generator erd {
  provider = "prisma-erd-generator"
  output = "../ERD.svg"
}

Extensions

  • svg (default: ./prisma/ERD.svg)
  • png
  • pdf
  • md

Theme

Theme selection

Usage

generator erd {
  provider = "prisma-erd-generator"
  theme = "forest"
}

Options

  • default (default)
  • forest
  • dark
  • neutral