https://github.com/k-kawa/erd
Simplest DSL to draw ER diagrams executable on any environments
https://github.com/k-kawa/erd
draw-er-diagrams dsl erd
Last synced: 6 months ago
JSON representation
Simplest DSL to draw ER diagrams executable on any environments
- Host: GitHub
- URL: https://github.com/k-kawa/erd
- Owner: k-kawa
- Created: 2016-05-11T14:45:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T07:12:29.000Z (about 8 years ago)
- Last Synced: 2024-08-03T05:23:58.848Z (9 months ago)
- Topics: draw-er-diagrams, dsl, erd
- Language: Go
- Homepage:
- Size: 180 KB
- Stars: 36
- Watchers: 5
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ERD
The compiler of the *simplest* DSL to draw ER diagrams. This project is still under PoC phase.
## Install
Execute the following command to install the latest version.
go get github.com/k-kawa/erd
Or [download](https://github.com/k-kawa/erd/releases) the executable binary suitable for your environment
## Usage
You can write the table definitions with your favorite editor like this
User : All our customers {
id
email varchar(128) : User's email address
name : User's name
}
Post {
id
blog_id -> Blog.id
category_id -> Category.id
title : title of the blog post
text : plain text of the blog post
}
Blog {
id
user_id -> User.id
name
}
Category {
id
name
parent_category_id ..> Category.id
blog_id -> Blog.id
}
and store it to `sample.erd`.
Then, you can convert it to the Graphviz Dot format with `erd` command like this.$ cat sample.erd | erd convert
digraph er {
....
}Finally you can convert it to a PNG image with `dot` command like this.
$ cat sample.erd | erd convert | dot -Tpng -o sample.png

## License
MIT