• Stars
    star
    284
  • Rank 140,270 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created 8 months ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Markdown generator of Prisma, including ERD and descriptions

Prisma Markdown

Outline

GitHub license npm version Downloads Build Status

Prisma markdown documents generator.

  • Mermaid ERD diagrams
  • Descriptions by /// comments
  • Separations by @namespace comments

If you want to see how markdown document being generated, visit below examples:

Example Case

Setup

At first, install NPM package.

npm i -D prisma-markdown

At next, add the generator to the schema file.

generator markdown {
  provider = "prisma-markdown"
  output   = "./ERD.md"
  title    = "Shopping Mall"
}

At last, run below command, than ERD.md file would be generated.

npx prisma generate

Comment Tags

If your database has over hundreds of models, none of automatic ERD generators can express them perfect. In that case, prisma-markdown recommends you to separate hundreds of models to multiple paginated diagrams by using /// @namepsace <name> comments.

When you write /// @namepsace <name> comment on models, they would be separated to proper sections of markdown document. For reference, you can assign multiple @namepsaces to a model, and if you do not assign any @namepsace to a model, it would be assigned to default tag.

Also, if you use @erd <name> instead of @namespace <name>, target model would be expressed only at ERD. It would not be appeared to the markdown content section. Otherwise, @describe <name> tag will show the model only at markdown content section, not at ERD.

  • @namespace <name>: Both ERD and markdown content
  • @erd <name>: Only ERD
  • @describe <name>: Only markdown content
  • @hidden: Neither ERD nor markdown content
  • @minItems 1: Mandatory relationship when 1: N (||---|{)
/// Both description and ERD on Actors chatper.
///
/// Also, only ERD on Articles and Orders chapters.
///
/// @namespace Actors
/// @erd Articles
/// @erd Orders
model shopping_customers {
  /// The tag "minItems 1" means mandatory relationship `||---|{`.
  ///
  /// Otherwise, no tag means optional relationship `||---o{`.
  ///
  /// @minItems 1
  login_histories shopping_customer_login_histories[]
}

/// Only description on Actors chapter.
///
/// @describe Actors
model shopping_customer_login_histories {}

/// Only ERD on Articles chapter.
///
/// @erd Articles
model shopping_sale_reviews {}

/// Never be shown.
///
/// @hidden
model shopping_sale_hits {}

More Repositories

1

typia

Super-fast/easy runtime validations and serializations through transformation
TypeScript
4,050
star
2

nestia

Make NestJS much faster and easier
TypeScript
1,612
star
3

backend

A template repository for TypeScript backend server
TypeScript
609
star
4

tstl

TypeScript-STL (Standard Template Library, migrated from C++)
TypeScript
585
star
5

payments

Korean Payment System with Mockup servers of PGs
TypeScript
317
star
6

safe-typeorm

TypeORM helper library enhancing safety in the compilation level
TypeScript
227
star
7

tgrid

TypeScript Grid Computing Framework supporting RFC (Remote Function Call)
TypeScript
119
star
8

fake-iamport-server

Fake Iamport Server with Real SDK
95
star
9

framework

Deprecated, use TGrid instead
C++
71
star
10

resume

CSS
46
star
11

astl

Standard Template Library for AssemblyScript
TypeScript
36
star
12

nestia-helper

NestJS helper with Type level
TypeScript
34
star
13

mutex

Mutex Server using WebSocket
TypeScript
29
star
14

bbs-backend

Simple Bullet-in Board System Backend
TypeScript
19
star
15

sxml

Simple XML Library for TypeScript (JavaScript)
TypeScript
16
star
16

fast-object

Fast object creator, via JSON.parse(), but type safe
TypeScript
16
star
17

nestia-start

Nestia template project installed by "npx nestia start"
TypeScript
15
star
18

websocket-polyfill

WebSocket class from Browser to NodeJS
TypeScript
11
star
19

ecol

Event Collections
TypeScript
9
star
20

samchon

8
star
21

cagen

Number of Case Generator
TypeScript
5
star
22

schedules

Open source development schedule of Samchon
5
star
23

openapi

Type safe OpenAPI definitions
TypeScript
5
star
24

big-associative

Big associative containers who can store over 14M elements.
TypeScript
5
star
25

encrypted-fetcher

Rest API Fetcher with AES Encryption
TypeScript
4
star
26

typedoc-plugin-exclude-references

temporary plug-in
TypeScript
4
star
27

environments

My development environments
4
star
28

import2

lazy import function who can prevent transpiled to require
JavaScript
4
star
29

safeorm

Ultimate Safe ORM for the TypeScript
TypeScript
4
star
30

tgrid.projects.chat

Demo Project - Chat Application
TypeScript
3
star
31

nestia-fetcher

Fetcher library for the Nestia
TypeScript
3
star
32

oss-2019

공개소프트웨어 개발자대회 2019
CSS
2
star
33

URLVariables

URLVariables class for TypeScript
TypeScript
2
star
34

nestjs-custom-decorator-exception-filter

2
star
35

nestia-auto-crud-example

For https://github.com/samchon/nestia/issues/670
TypeScript
1
star
36

nestjs-study-router-module

To support RouterModule in Nestia
TypeScript
1
star
37

prisma-bug-report-postgres-timestampz

A prisma bug reproduction repo for reporting about `timestampz` type in Postgres
1
star
38

tgrid.com

Guide Documents for TGrid
HTML
1
star
39

tgrid.projects.market

Demo Project - Grid Market
TypeScript
1
star
40

gitbook-plugin-hide-navigation-buttons

Gitbook Plugin: Hide Navigation Buttons
CSS
1
star
41

tgrid.examples

Example Source Codes for TGrid
TypeScript
1
star
42

timetable

Hansung Timetable
ActionScript
1
star
43

samchon.github.io

My homepage
HTML
1
star
44

gitbook-plugin-scroll-to-top

JavaScript
1
star
45

ts-patch-typescript-v5.3-test

JavaScript
1
star
46

nestia-sdk-template

Nestia SDK Template Repository for `@nestia/migrate`
TypeScript
1
star