1.4.0 • Published 4 months ago

prisma-generator-plantuml-erd v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

prisma-generator-plantuml-erd

Prisma generator to create an ER Diagram for plantuml.

You can generate the plantuml source code from the schema.prisma.

npm.io

example

usage

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

Add to your schema.prisma

generator erd_plantuml {
  provider   = "prisma-generator-plantuml-erd"
  output = "erd.puml"
}

Run the generator

$ npx prisma generate

Versions

This generator only support prisma3. If you use the version greater than 4, this plugin is not work.

Options

output

The path of generated plantuml file path. The default value is './erd.puml'

usePhysicalTableName

If this flag is true, physical table name is used for name of table on er diagram. The default value is false;

model User {
  id            String         @id

  @map("users")
}

If this flag is set to true, then "users" will be displayed on the diagram, otherwise "User" is displayed on the diagram.

exportPerTables

If this flag is true, generate some tables If this flag is true, it also generate some diargrams that based on each table. The diagrams is rendered with only the tables that related with base table. The default value is false.

example

lineLength

You can change the length of relation line by this option. The default value is '--'.

In the default case

Table1 }o--o| Table3

if you set this flag to '---'

Table1 }o---o| Table3

showUniqueKeyLabel

If this flag is true, unique column is also labeled as unique key on er diagram, like [UK]. The default value is false.

markdownOutput

If this flag is set, a markdown table definition will be generated as well.

example

markdownIncludeERD

If this flag is true, an ER diagram for each table is generated on the table definitions The default value is false.

asciidocOutput

If this flag is set, a asciidoc table definition will be generated as well.

example

asciidocIncludeERD

If this flag is true, an ER diagram for each table is generated on the table definitions The default value is false.

Example

The example config is here.

generator erd_plantuml {
  output               = "path/to/output.puml"
  lineLength           = "----"
  exportPerTables      = true
  usePhysicalTableName = false
  showUniqueKeyLabel = true
  markdownOutput       = "./example-tables.md"
  markdownIncludeERD      = true
  asciidocOutput       = "./example-tables.adoc"
  asciidocIncludeERD      = true
}
1.4.0

4 months ago

1.3.2

6 months ago

1.3.1

6 months ago

1.3.0

6 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago