erd: An entity-relationship diagram generator from a plain text description.

[ database, development, program, public-domain ] [ Propose Tags ]

erd transforms a plain text description of a relational database schema to a graphical representation of that schema. It is intended that the graph make use of common conventions when depicting entity-relationship diagrams, including modeling the cardinality of relationships between entities.

A quick example that transforms an er file to a PDF:

$ curl '' >
$ cat
# Entities are declared in '[' ... ']'. All attributes after the entity header
# up until the end of the file (or the next entity declaration) correspond
# to this entity.


# Each relationship must be between exactly two entities, which need not
# be distinct. Each entity in the relationship has exactly one of four
# possible cardinalities:
# Cardinality    Syntax
# 0 or 1         0
# exactly 1      1
# 0 or more      *
# 1 or more      +
Person *--1 Location
$ erd -i -o simple.pdf

The PDF should now contain a graph that looks like this:

See the file for more examples and instructions on how to write ER files.

Versions [faq],,,,
Dependencies base (==4.6.*), bytestring (==0.10.*), containers (==0.5.*), graphviz (==2999.16.*), parsec (==3.1.*), text (==0.11.*) [details]
License LicenseRef-PublicDomain
Author Andrew Gallant
Category Database, Development
Home page
Source repo head: git clone git://
Uploaded by burntsushi at Thu Jan 16 03:18:05 UTC 2014
Distributions NixOS:
Executables erd
Downloads 3251 total (177 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2016-12-18 [all 7 reports]


Maintainer's Corner

For package maintainers and hackage trustees