SimpleERD¶ ↑
SimpleERD is a tool to generate beautiful ERD digrams from plain text.
SimpleERD started out as an experiment and is currently at its early stage of development. Consider it a working prototype. SimpleERD is written in Ruby, but this is likely subject for a change.
Installation¶ ↑
There are two installation options on macOS:
-
via {
homebrew
}:
bash $ brew tap gmile/apps $ brew install simple-erd --HEAD
-
via {
rubygems
}: -
make sure to have
graphviz
installed:bash $ brew install graphviz
-
intall the gem:
bash $ gem install simple-erd
Usage¶ ↑
SimpleERD requires a text file as an input. Input file contains text formatted the following way:
[entity_1] attribute | type [entity_2] attribute | type | modifier [entity_3] attribute (entity_group_1) entity_1 entity_2 (entity_group_2) entity_3 entity_1 ?--1 entity_2 entity_3 *--n entity_2
Here, [entity_1]
starts a block, indicating an entity. Right below [entity_1]
come entity attributes. An entity attribute is defined by a attribute_name
, type
(optional and modifier
(optional).
At the bottom of input file – relations between entities. Syntax for relations:
-
?
– 0 or 1 -
1
– exactly 1 -
*
– 0 or more -
+
– 1 or more -
x
– relation is undefined, will render as???
in the output.
Examples¶ ↑
$ simple-erd -i samples/complex_input.txt -o /tmp/output.pdf
See /samples for more samples.
Motivation¶ ↑
I was inspired by {erd
} from Andrew Gallant, but had a couple of issues with it:
-
mainly I found it hard, although possible, to install:
-
erd
requires haskell runtime to be available, which takes around 1Gb when installed. -
it is required to install
cabal
and all oferd
's dependencies manually. -
the libarary doesn't seem to be actively maintained.
Also, I wanted to work on the custom styling of the diagram.
Licence¶ ↑
MIT