GithubHelp home page GithubHelp logo

burntsushi / erd Goto Github PK

View Code? Open in Web Editor NEW
1.8K 36.0 152.0 307 KB

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.

License: The Unlicense

Makefile 0.56% Haskell 90.75% Vim Script 0.10% Shell 3.08% Nix 4.33% Dockerfile 1.17%

erd's Introduction

Build Status Hackage

This utility takes a plain text description of entities, their attributes and the relationships between entities and produces a visual diagram modeling the description. The visualization is produced by using Dot with GraphViz. There are limited options for specifying color and font information. Also, erd can output graphs in a variety of formats, including but not limited to: pdf, svg, eps, png, jpg, plain text and dot.

Here's an example of the output produced by erd (click on it for a larger PNG version):

ER diagram for nfldb

The corresponding er file is in the examples directory.

Installation

erd requires GraphViz, and one of:

All of these are available for Windows, Mac and Linux.

MacPorts

erd is available in MacPorts as a one-shot install (GraphViz will be set up correctly for you):

port install erd

Docker

docker run -i ghcr.io/burntsushi/erd:latest < examples/nfldb.er >| out.pdf

All available tags.

Local Docker build

An example command to use erd in a docker container, once this repository is successfully cloned.

erdtag="0.2.1.0"; cd erd && docker build -t erd:$erdtag . && docker run -it erd:$erdtag "--help"

Where:

  • you shall specify your erdtag, that will help identifying the docker image to be created;
  • instead of using --help invoke erd the way you need to i.e.:
    docker run -i erd:$erdtag "--dot-entity" < examples/nfldb.er > out.pdf
    

Stack

Install the Stack build tool, and build from source:

git clone git://github.com/BurntSushi/erd
cd erd
stack install

stack install will put the binary into Stack's standard binary installation path. Unless you've overridden it, that's ~/.local/bin on Unix and OS X, %APPDATA%\local\bin on Windows.

Haskell Platform

NB OSX users: for text formatting of keys (bold and italics) you may need to reinstall graphviz with pango support:

# OSX only
brew install graphviz

The issue 1636 explains what needs to be performed in details to find out whether pango support is enabled and how to make it happen in case it wasn't.

erd is on hackage, so you can install it with cabal (which is included with the Haskell platform):

cabal new-install erd

Alternatively, you can clone this repository and build from source:

git clone git://github.com/BurntSushi/erd
cd erd
cabal new-configure
cabal new-build
# binary is now under ./dist-newstyle/build/

Usage information is available with erd --help.

Building statically linked executable

In case one wishes to have a statically linked erd as a result, this is possible to have by executing build-static_by-nix.sh: which requires the nix package manager to be installed on the building machine. NixOS itself is not a requirement.

Quick example

Before describing the ER file, let's try making an ER diagram from a small example:

$ curl 'https://raw.githubusercontent.com/BurntSushi/erd/master/examples/simple.er' > simple.er
$ cat simple.er
# 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.
[Person]
*name
height
weight
`birth date`
+birth_place_id

[`Birth Place`]
*id
`birth city`
'birth state'
"birth country"

# 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         ?
# exactly 1      1
# 0 or more      *
# 1 or more      +
Person *--1 `Birth Place`
$ erd -i simple.er -o simple.pdf

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

Simple erd example graph

Available command-line options

Short Long Description
-c[FILE] --config[=FILE] Configuration file.
-i FILE --input=FILE When set, input will be read from the given file. Otherwise, stdin will be used.
-o FILE --output=FILE When set, output will be written to the given file. Otherwise, stdout will be used. If given and if --fmt is omitted, then the format will be guessed from the file extension.
-f FMT --fmt=FMT Force the output format to one of: bmp, dot, eps, gif, jpg, pdf, plain, png, ps, ps2, svg, tiff.
-e EDGE --edge=EDGE Select one type of edge: compound, noedge, ortho, poly, spline.
-d --dot-entity When set, output will consist of regular dot tables instead of HTML tables. Formatting will be disabled.
-p PATTERN --edge-pattern=PATTERN Select one of the edge patterns: dashed, dotted, solid.
-n NOTATION --notation=NOTATION Select a notation style for cardinalities of relations: ie, uml.
-h --help Show this usage message.

Formatting defined in configuration file

erd may be invoked using the -c or --config argument

  • without a provided configuration file it will try to read the file ~/.erd.yaml which is the path of the configuration file to store formatting settings of any resulted graph. In case the file ~/.erd.yaml does not exists erd will print the default content of this file to stdout which you can inspect and/or redirect appropriately, e.g.: erd -c -i ./examples/nfldb.er -o ./nfldb.pdf 1 > ~/.erd.yaml .

  • with a provided configuration file erd will use that instead of ~/.erd.yaml. For instance: erd -c./myconfig.yaml -i ./examples/nfldb.er -o ./nfldb.pdf .

The configuration file in commented sections do contain the supported formatting options, so you can use one of the listed ones.

The default content of the configuration file would be only shown when ~/.erd.yaml does not exist.

The er file format

The er format allows one to describe a relational schema in terms of its entities (tables), attributes (columns) and relationships between entities (0 or 1, exactly 1, 0 or more and 1 or more).

Entities are declared inside [ and ]. For example, this declares the entity Person with no attributes:

[Person]

Attributes for an entity are then listed after its corresponding entity's declaration. Each attribute should be on its own line. The following adds the name and height attributes to the Person entity:

[Person]
name
height

Entity names and attributes may contain spaces and mostly any character, except ASCII control characters like carriage return and line feed, if quoted with backticks, simple quotes or double quotes:

[`Birth Place`]
*id
`birth city`
'birth state'
"birth country"

Any number of attributes may be declared as a primary key for its entity by prefixing the attribute with a *. Similarly, an attribute may be declared as a foreign key by prefixing the attribute with a +:

[Person]
*name
+birth_place_id

An attribute may be both a primary key and a foreign key by prefixing the name with a * and a + in any order. Note that primary keys are underlined while foreign keys are italicized.

Relationships can also be declared anywhere in an ER file. Every relationship includes exactly two entities (the two entities may be the same, for self-relationships). Each entity in a relationship must have exactly one of four cardinalities:

Cardinality    Syntax
0 or 1         ?
exactly 1      1
0 or more      *
1 or more      +

So for example, the following defines a relationship between Person and Birth Place that reads "every person has exactly one birth place":

Person *--1 `Birth Place`

And here's another example that can be read as, "every platinum album has one or more artists, but not every artist has a platinum album":

Artist +--? PlatinumAlbums

Fonts, colors, labels, ...

The er format also has limited support for customizing the appearance of your ER diagram. For example, the following will show the entity with a background color of #ececfc and a font size of 20:

[Person] {bgcolor: "#ececfc", size: "20"}
name
height
weight

Which looks like:

example of changing background color

Alternatively, you can specify the background color of every entity with a special directive at the top of the file:

entity {bgcolor: "#ececfc", size: "20"}

[Person]
name
height
weight

[`Birth Place`]
place

There are three other directives: title, header and relationship. The title directive allows one to specify a title for the graph and provide options for formatting it. The header directive allows one to customize the formatting of every entity header. And similarly for relationship. Note that global options are overwritten by local options.

Note that directives must come before anything else in an ER file.

Here's an example depicting the first schema shown at the top of this README (note that this is auto-generated by nfldb-write-erd):

title {label: "nfldb Entity-Relationship diagram (condensed)", size: "20"}

# Entities

[player] {bgcolor: "#d0e0d0"}
  *player_id {label: "varchar, not null"}
  full_name {label: "varchar, null"}
  team {label: "varchar, not null"}
  position {label: "player_pos, not null"}
  status {label: "player_status, not null"}

[team] {bgcolor: "#d0e0d0"}
  *team_id {label: "varchar, not null"}
  city {label: "varchar, not null"}
  name {label: "varchar, not null"}

[game] {bgcolor: "#ececfc"}
  *gsis_id {label: "gameid, not null"}
  start_time {label: "utctime, not null"}
  week {label: "usmallint, not null"}
  season_year {label: "usmallint, not null"}
  season_type {label: "season_phase, not null"}
  finished {label: "boolean, not null"}
  home_team {label: "varchar, not null"}
  home_score {label: "usmallint, not null"}
  away_team {label: "varchar, not null"}
  away_score {label: "usmallint, not null"}

[drive] {bgcolor: "#ececfc"}
  *+gsis_id {label: "gameid, not null"}
  *drive_id {label: "usmallint, not null"}
  start_field {label: "field_pos, null"}
  start_time {label: "game_time, not null"}
  end_field {label: "field_pos, null"}
  end_time {label: "game_time, not null"}
  pos_team {label: "varchar, not null"}
  pos_time {label: "pos_period, null"}

[play] {bgcolor: "#ececfc"}
  *+gsis_id {label: "gameid, not null"}
  *+drive_id {label: "usmallint, not null"}
  *play_id {label: "usmallint, not null"}
  time {label: "game_time, not null"}
  pos_team {label: "varchar, not null"}
  yardline {label: "field_pos, null"}
  down {label: "smallint, null"}
  yards_to_go {label: "smallint, null"}

[play_player] {bgcolor: "#ececfc"}
  *+gsis_id {label: "gameid, not null"}
  *+drive_id {label: "usmallint, not null"}
  *+play_id {label: "usmallint, not null"}
  *+player_id {label: "varchar, not null"}
  team {label: "varchar, not null"}

[meta] {bgcolor: "#fcecec"}
  version {label: "smallint, null"}
  season_type {label: "season_phase, null"}
  season_year {label: "usmallint, null"}
  week {label: "usmallint, null"}

# Relationships

player      *--1 team
game        *--1 team {label: "home"}
game        *--1 team {label: "away"}
drive       *--1 team
play        *--1 team
play_player *--1 team

game        1--* drive
game        1--* play
game        1--* play_player

drive       1--* play
drive       1--* play_player

play        1--* play_player

player      1--* play_player

All formatting options

erd only exposes a subset of formatting options made available by GraphViz. I'm not entirely opposed to expanding this list if there's a compelling reason to do so, but I'd prefer to keep it small and simple.

Note that not all options are applicable on all items. For example, a title cannot have a background color (it will just be ignored by GraphViz).

Colors can be specified in hexadecimal notation prefixed with a #, e.g., #3366ff or they may be written as their English names.

  • label A plain text string used to label the item. For entity names and attributes, a label is shown next to the name in square brackets. For relationships, a label is drawn near the center of the edge. For the special title directive, the label corresponds to the graph title.
  • color Specifies the font color. Valid everywhere.
  • bgcolor Specifies the background color. Only valid for entities and attributes.
  • size Specifies the font size. Valid everywhere.
  • font Specifies the font. Valid everywhere. See this for information about fonts in GraphViz. TL;DR: Stick with one of the following: Times-Roman, Helvetica or Courier.
  • border-color Border color. Only works for entities or attributes.
  • border Border size in pixels. Only works for entities and attributes.

Formatting options are always specified as key-value pairs in curly braces, where the opening curly brace starts on the same line as the entity/attribute/relationship/directive. The option name precedes a colon and the option value comes after the colon in double quotes (even for integer values). The value is then preceded by either a comma or an ending curly brace. Also note that trailing commas are allowed and that options may be specified over more than one line. For example, the following is a valid er file:

[Person]
  name {
    label: "string",
    color: "#3366ff", # i like bright blue
  }
  weight {
    label: "int",}

Philosophy

I don't intend for erd to have a large feature set with a lot of options for customizing the appearance of ER diagrams. erd should produce diagrams that are "good enough" from simple plain text descriptions without a lot of complexity. erd will implicitly trust GraphViz to "do the right thing" without a lot of fiddling with its options.

If you have more exotic needs, then I suggest that either erd is not the right tool, or you could use erd to output an er file as a dot file. You can then customize it further manually or using some other tool.

You can output a dot file using the --fmt option or by simply using it as a file extension:

erd -i something.er -o something.dot

Similar software

The format of the er file is inspired by the file format used by the project erwiz (which looks abandoned). The er format is a bit more lightweight, but its general structure is similar.

Similar software that translates a plain text description of a relational schema to a graphical visualization (the list may be incomplete and some of the listed projects are no longer maintained):

Text editor support

erd's People

Contributors

0xflotus avatar amake avatar andres-lowrie avatar ariera avatar bollafa avatar burntsushi avatar christian-heusel avatar combinatorist avatar creasty avatar dariusjonda avatar deining avatar echeon avatar eric-brechemier avatar felixvanoost avatar fgaray avatar kukimik avatar ldcasillas-progreso avatar marzocchi avatar mmzx avatar phagenlocher avatar stijnherreman avatar xavriley avatar zhujinxuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erd's Issues

looking for maintainer(s)

This package has been fairly unmaintained for a long time, but there is a steady stream of interest in it. I doubt I'll ever get back into this project specifically, so I'd be happy to see it live on in the hands of someone else.

My thinking is that I could add interested parties as contributors to this repo. If things go well for a ~year, then I'd be happy to just transfer ownership of the repo itself.

text alignment?

I'm running this on OSX High Sierra, installed via Stack.

My attributes seem to be right aligned, whereas the sample pdf is left aligned. I think left aligned makes it so much easier to read.

How can I specify this? I don't think there's an option in the README.

This is what I get

Fail to install on OSX Sierra

Failed to install erd with cabal.

$ cabal install erd
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: base (dependency of erd-0.1.3.0)
rejecting: base-4.9.1.0/installed-4.9... (conflict: erd => base==4.7.*)
rejecting: base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0,
base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1,
base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0,
base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0,
base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from
non-upgradeable package requires installed instance)
Dependency tree exhaustively searched.
$

FYI, my environment is follows.

sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.4
BuildVersion:	16E195

Improve warning when graphviz is missing

First off, awesome tool - thanks!

I had one hiccup getting started - I ran cabal install erd and saw something about graphviz in the output, so I incorrectly assumed that dependency was taken care of automatically. When I tried to use erd I would get the confusing error:

erd: dot: runInteractiveProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

which after a few minutes I realized meant that dot was not found, meaning graphviz. After installing that everything is fine, of course.

I realize it's mentioned as a requirement in the README, but a warning if dot isn't found along the lines of Looks like Graphviz isn't installed, can't find the 'dot' program would probably be helpful for new users.

Fails to install on Arch Linux

It fails to install on Arch Linux. I believe I have installed all the needed dependencies (graphviz, ghc, cabal-install,...) but it still has errors and it won't install. This is the output of the cabal configure command:

Warning: The configure command is a part of the legacy v1 style of cabal
usage.
Please switch to using either the new project style and the new-configure
command or the legacy v1-configure alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: erd-0.1.3.0 (user goal)
[__1] trying: text-1.2.3.1/installed-1.2... (dependency of erd)
[__2] next goal: binary (dependency of text)
[__2] rejecting: binary-0.8.6.0/installed-0.8... (conflict: erd =>
containers==0.5.*, binary => containers==0.6.0.1/installed-0.6...)
[__2] fail (backjumping, conflict set: binary, erd, text)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: erd, binary, text
Trying configure anyway.
Configuring erd-0.1.3.0...
cabal: Encountered missing dependencies:
containers ==0.5.*

Add support of regular dot tables as output, apart from html.

As the README itself promotes:

(I would not be against a small addition to erd that uses no formatting and writes entities as regular dot tables.)

There's a very rough support of it here

It's still quite ad-hoc, and I created this issue to discuss the implementation details, such as
the new option name and how to refactor the function that maps an ER diagram to a GraphViz one.

I have added the option --no-html to choose between the two modes ( and while I was testing if I had added it correctly i found #71 )

Output raw dot file

Instead of just having erd call graphviz, could it also output the generated dot file for further hand editing, as another output format?

watching an input file

It would be nice to have erd be able to watch an input file for changes and then mirror the changes into the transformed file.

it would be nice to allow the relationships to terminate at particular fields.

Right now the relationships are table to table.
[users]
*id
name

[cats]
*id
name
owner_id

users 1--* cats
However inside a database, the relationships are expressed as a field to field. For example.

[users]
*id
name

[cats]
*id
name
owner_id

users:id 1--* cats: owner_id <----- THIS HERE IS WHAT IS DIFFERENT

It turns out that the dot language has a means of expressing the "port" to which a connecting line will connect. See page 20 of the follow doc: https://www.graphviz.org/pdf/dotguide.pdf. avoid the compass point concept and look at. the . things.

I realize this would not be backwards compatible since the

: notation is new. Perhaps there is a better technique to express this in the erd language.

Sorry no PR from at this time, I know nothing about Haskell.

Python 3.x compatibility issue (print function)

I found some Python 3.x compatibility issue.

My environment is following

$ python --version
Python 3.6.3

-s option does not work at Python 3.x environment.

$ eralchemy -i sqlite:///example.db -s example.er 
Traceback (most recent call last):
  File "/Users/amedama/.virtualenvs/py36/bin/eralchemy", line 11, in <module>
    sys.exit(cli())
  File "/Users/amedama/.virtualenvs/py36/lib/python3.6/site-packages/eralchemy/main.py", line 29, in cli
    check_args(args)
  File "/Users/amedama/.virtualenvs/py36/lib/python3.6/site-packages/eralchemy/helpers.py", line 22, in check_args
    fail('Cannot draw ER diagram with no output file.')
  File "/Users/amedama/.virtualenvs/py36/lib/python3.6/site-packages/eralchemy/helpers.py", line 6, in fail
    print >> sys.stderr, 'Error:', message % args
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?

Since print became a function at Python 3.x.

Request for release

Looking at the instructions it doesn't seem overly complicated to compile erd for Linux, but I kind of feel a resistance to installing Haskell just for this (never needed it before) and at least getting a shallow insight into that universe.

As such I was wondering if it might be possible to perhaps just make a release for Linux, containing nothing more than the erd binary? (I'm making the assumption that erd is a single file.)

Please? :)

Build Error on WSL1 + Ubuntu 18.04

Hello!

I'm trying to build this on Ubuntu 18.04 on WSL1. Everything goes fine until attempting to build erd-0.2.1.0 itself. This is from the erd-0.2.1.0.log:

Building erd-0.2.1.0...
Preprocessing executable 'erd' for erd-0.2.1.0...
[1 of 7] Compiling Paths_erd        ( dist/build/autogen/Paths_erd.hs, dist/build/erd/erd-tmp/Paths_erd.o )
[2 of 7] Compiling Erd.ER           ( src/Erd/ER.hs, dist/build/erd/erd-tmp/Erd/ER.o )
[3 of 7] Compiling Erd.Render       ( src/Erd/Render.hs, dist/build/erd/erd-tmp/Erd/Render.o )
[4 of 7] Compiling Text.Parsec.Erd.Parser ( src/Text/Parsec/Erd/Parser.hs, dist/build/erd/erd-tmp/Text/Parsec/Erd/Parser.o )

src/Text/Parsec/Erd/Parser.hs:70:69: error:
   โ€ข Variable not in scope:
      (<>) :: M.Map String Option -> Options -> Options
   โ€ข Perhaps you meant one of these:
      โ€˜<|>โ€™ (imported from Text.Parsec), โ€˜<*>โ€™ (imported from Prelude),
      โ€˜*>โ€™ (imported from Prelude)
cabal: Leaving directory '/tmp/cabal-tmp-10632/erd-0.2.1.0'

I let cabal install all the dependencies, fwiw.

I'm guessing, given this is insrc/Text/Parsec/Erd/Parser.hs, that I'd clone the repo and change the line

$ A Attribute {field = n, pk = ispk, fk = isfk, aoptions = opts <> defaultAttrOpts}

to

$ A Attribute {field = n, pk = ispk, fk = isfk, aoptions = opts <|> defaultAttrOpts}

but I don't know from Haskell.

Thank you for your time. I know the maintenance of this tool is up-in-the-air. If there is more information I can provide to be of help, let me know.

Building docker image from scratch fails

Example input: erdtag="0.2.1.0-2"; cd erd && docker build -t erd:$erdtag . && docker run -it erd:$erdtag "--help"
Results in:

Sending build context to Docker daemon  350.2kB
Step 1/5 : FROM haskell:8
 ---> b3ecd18b6c75
Step 2/5 : WORKDIR /opt/erd
 ---> Using cache
 ---> 45b772d321dc
Step 3/5 : RUN apt-get update && apt-get install -y graphviz
 ---> Running in 4ea76782f159
Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease
  Temporary failure resolving 'deb.debian.org'
Err:3 http://downloads.haskell.org/debian buster InRelease
  Temporary failure resolving 'downloads.haskell.org'
Err:4 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://downloads.haskell.org/debian/dists/buster/InRelease  Temporary failure resolving 'downloads.haskell.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package graphviz
The command '/bin/sh -c apt-get update && apt-get install -y graphviz' returned a non-zero code: 100

install error on mac

brew reinstall graphviz --with-pango                                                                                                             ๎‚ฒ ๏€Œ
Usage: brew reinstall [options] formula

Uninstall and then install formula (with existing and any appended install options).

    -d, --debug                      If brewing fails, open an interactive
                                     debugging session with access to IRB or a
                                     shell inside the temporary build directory
    -s, --build-from-source          Compile formula from source even if a
                                     bottle is available.
        --force-bottle               Install from a bottle if it exists for the
                                     current or newest version of macOS, even if
                                     it would not normally be used for
                                     installation.
        --keep-tmp                   Don't delete the temporary files created
                                     during installation.
    -f, --force                      Install without checking for previously
                                     installed keg-only or non-migrated
                                     versions.
    -v, --verbose                    Print the verification and postinstall
                                     steps.
        --display-times              Print install times for each formula at the
                                     end of the run.
    -h, --help                       Show this message.
Error: invalid option: --with-pango

Error Install on 64-bit ArchLinux

$ cabal install erd 
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: base (dependency of erd-0.1.3.0)
rejecting: base-4.9.0.0/installed-4.9... (conflict: erd => base==4.7.*)
rejecting: base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0,
base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0,
base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0,
base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0,
base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable
package requires installed instance)
Dependency tree exhaustively searched.

installed archlinux package:

gts-0.7.6-3  ghc-8.0.1-1  graphviz-2.38.0-13
cabal-install-1.24.0.0-2

the same with second method

$ cabal configure
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: parsec (dependency of erd-0.1.3.0)
Dependency tree exhaustively searched.
Trying configure anyway.
Configuring erd-0.1.3.0...
cabal: Encountered missing dependencies:
graphviz ==2999.*, parsec ==3.1.*, text ==1.*
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: parsec (dependency of erd-0.1.3.0)
Dependency tree exhaustively searched.
Trying configure anyway.
Configuring erd-0.1.3.0...
cabal: Encountered missing dependencies:
graphviz ==2999.*, parsec ==3.1.*, text ==1.*

Installation issues

Hi,

Cool tool!

I did have some issues installing on OS X + Homebrew, though:

  • cabal install erd does not work at all
  • Installing manually fails as well:
    • base is set to be larger than 4.5, but the current version is 4.11 which for some reason is not seen as being larger than 4.5 (probably a cabal issue?). Workaround: set base >= 4.1
    • graphviz is not installed automatically, so you need to manually do cabal install graphviz

Once you've done this, however, building and running erd works fine.

I suspect both of these are cabal issues and not so much erd issues, but it might be nice to mention them in the installation instructions.

Resolving dependencies on Windows

I'm getting the following error on Windows. I've installed it from source, installed GraphViz, and set the path for the latter's bin directory as well; I know it is working as dot -V gives me correct output.

Resolving dependencies...
cabal.exe: Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: base (dependency of erd-0.1.3.0)
rejecting: base-4.8.2.0/installed-140... (conflict: erd => base==4.7.*)
rejecting: base-4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0,
4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1,
4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires
installed instance)
Dependency tree exhaustively searched.

I've also tried running the command after using the cabal update command. Any ideas?

Thanks for your time.

Releasing a new version

There are some reasons that would favor creating a new version:

  • Issue #14 has been actually done in commit: 51b0807 .
  • It would be nice to have a new version uploaded to hackage and that requires at least a minor version bump.
  • There has been new features added.
  • The new build system of hackage would be utilized, currently (#14) does not let the build to succeed.

What would you think about the new version to be 0.1.3.1 to make a minor version bump?

graphviz == 2999 not found

Hi there,

I have a problem installing erd on my system.

Using cabal install erd, I get

cabal: Could not resolve dependencies:
trying: erd-0.1.3.0 (user goal)
next goal: base (dependency of erd-0.1.3.0)
rejecting: base-4.8.0.0/installed-901... (conflict: erd => base==4.7.*)
rejecting: base-4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0,
4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0,
4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires installed
instance)
Dependency tree exhaustively searched.

Trying to download the source and firing up cabal configure, graphiz does not seem to be found.

Configuring erd-0.1.3.0...
cabal: At least the following dependencies are missing:
graphviz ==2999.*

cabal update was previously run.

Any held would be appreciated.

Using Erd as a library

First of all compliments for reaching 100 stars :D
I would like to use Erd as a library in a Web Server (to generate diagrams), are you considering making erd available on hackage also as a library?

Cannot compile on Ubuntu 16.04

Running a "camel configure" gives me the following error:

cabal configure Resolving dependencies... Configuring erd-0.1.3.0... cabal: At least the following dependencies are missing: graphviz ==2999.*, parsec ==3.1.*, text ==1.*

How can this be solved?

Any desire to make this a service?

I proposed the same idea in project today which takes a similar text based approach to rendering UML sequence diagrams as SVG. I personally feel that the ability to write fluidly about technical ideas in the form of markdown is a big help. Having a service that would let you render any type of visualization during your stream of conscious seems like it could be quite helpful.

The idea being something like this:

![INITIAL IDEA](http://service/
[Person]//
*name//
height//
weight//
+birth_location_id////
[Location]//
*id//
city//
state//
country//)]

This would output a PNG rendering of the image in the markdown.

This is the other project which sort of rides a similar idea this one... https://github.com/bramp/js-sequence-diagrams

Long command line arguments do not work properly

Long command line arguments is chosen even though its full name hasn't been provided.
Given command line argument:
erd --ed
Should output:
unrecognized option "--ed"
But instead it outputs:
option "--ed" requires argument EDGE
It seems that if just part of the name of the argument matches, it matches the option with the corresponding full name. ( i.e --ed matches to --edge )
I don't know whether this is intentional but I'm guessing that it isn't.

Stack Bytestring

On linux, had stack v1.5.something

Tried stack upgradeing but it kept
throwing
4077

rm -rf ~/.stack
rm -rf ~/.local/bin/stack


Finally install with force.
curl -sSL https://get.haskellstack.org/ | sh -s - -f

./build-static_by-nix.sh doesn't work

I guess this is because of this: nh2/static-haskell-nix#95

For the record, the problem looks like:

$ ./build-static_by-nix.sh 
+ /nix/store/4jl99687r2r5xdxis5g93v7cy5rmzrjb-stack2nix-0.2.3/bin/stack2nix /home/thu/projects/erd --stack-yaml stack.yaml --hackage-snapshot 2019-11-10T00:00:00Z -o /tmp/stack2nix-output-dir.r7OH7G2Zfd/stack2nix-output.nix
Ensuring git version is >= 2 ...
Ensuring cabal version is >= 2 ...
stack2nix: RedownloadInvalidResponse Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-16.0.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 "/home/thu/.stack/build-plan/lts-16.0.yaml" (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Connection","keep-alive"),("Content-Length","14"),("Content-Security-Policy","default-src 'none'; style-src 'unsafe-inline'; sandbox"),("Strict-Transport-Security","max-age=31536000"),("X-Content-Type-Options","nosniff"),("X-Frame-Options","deny"),("X-XSS-Protection","1; mode=block"),("Content-Type","text/plain; charset=utf-8"),("X-GitHub-Request-Id","B474:46F0:277EF:345D2:6031156E"),("Accept-Ranges","bytes"),("Date","Sat, 20 Feb 2021 13:58:06 GMT"),("Via","1.1 varnish"),("X-Served-By","cache-ams21053-AMS"),("X-Cache","MISS"),("X-Cache-Hits","0"),("X-Timer","S1613829487.654591,VS0,VE189"),("Vary","Authorization,Accept-Encoding"),("Access-Control-Allow-Origin","*"),("X-Fastly-Request-ID","aa6e14f2c09939438af93bee96f7be59b974b1e7"),("Expires","Sat, 20 Feb 2021 14:03:06 GMT"),("Source-Age","0")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose})
cp: cannot stat '/bin/erd': No such file or directory

Note that the Dockerfile builds fine.

N-nary relations

First of all, I would like to applaud you for this project I have been looking for a tool like this for a long time.

Secondly I want to ask if it is possible to support N-nary relation ships between tables.

0 or 1 relation fails

When I use 0 relation (0 or 1) which is in simple.er manual, I get following error.
Any clue?

unexpected '0'
expecting relationship or attribute

Building haddock documentaion for hackage fails.

The sequence of commands explained in here fails with the result

CallStack (from HasCallStack):
  error, called at ./Distribution/Client/CmdErrorMessages.hs:329:14 in main:Distribution.Client.CmdErrorMessages

It would be nice to have the code documentation uploaded onto hackage as well.

Build a statically linked binary

Hello and thanks for this project!

I'm trying to build a statically linked binary from the source. I'm not very familiar with the Haskell ecosystem so I've been using this blog post https://vaibhavsagar.com/blog/2018/01/03/static-haskell-nix/ to get me started.

I have the following Dockerfile to build the project:

# build static executable binary
FROM haskell:8

RUN git clone https://github.com/BurntSushi/erd.git

WORKDIR erd

RUN cabal new-update
RUN cabal new-install --lib
RUN cabal new-configure --disable-executable-dynamic --disable-shared --ghc-option=-optl=-static \
    && cabal new-build

As you can see I'm using new prefixed commands because cabal was complaining.
Anyway, the build is failing as you can see below:

Full trace
Failed to build base-compat-0.10.5.
Build log (
/root/.cabal/logs/ghc-8.6.3/base-compat-0.10.5-21d660624a01f5a1582e7e1c04d7244556c42ee79cec338da08f996cb2c9fba4.log
):
Configuring library for base-compat-0.10.5..
Preprocessing library for base-compat-0.10.5..
Building library for base-compat-0.10.5..
[  1 of 112] Compiling Control.Concurrent.Compat ( src/Control/Concurrent/Compat.hs, dist/build/Control/Concurrent/Compat.o )
[  2 of 112] Compiling Control.Concurrent.Compat.Repl ( src/Control/Concurrent/Compat/Repl.hs, dist/build/Control/Concurrent/Compat/Repl.o )
[  3 of 112] Compiling Control.Concurrent.MVar.Compat ( src/Control/Concurrent/MVar/Compat.hs, dist/build/Control/Concurrent/MVar/Compat.o )
[  4 of 112] Compiling Control.Concurrent.MVar.Compat.Repl ( src/Control/Concurrent/MVar/Compat/Repl.hs, dist/build/Control/Concurrent/MVar/Compat/Repl.o )
[  5 of 112] Compiling Control.Exception.Compat ( src/Control/Exception/Compat.hs, dist/build/Control/Exception/Compat.o )
[  6 of 112] Compiling Control.Exception.Compat.Repl ( src/Control/Exception/Compat/Repl.hs, dist/build/Control/Exception/Compat/Repl.o )
[  7 of 112] Compiling Control.Monad.Compat ( src/Control/Monad/Compat.hs, dist/build/Control/Monad/Compat.o )
[  8 of 112] Compiling Control.Monad.Compat.Repl ( src/Control/Monad/Compat/Repl.hs, dist/build/Control/Monad/Compat/Repl.o )
[  9 of 112] Compiling Control.Monad.Fail.Compat ( src/Control/Monad/Fail/Compat.hs, dist/build/Control/Monad/Fail/Compat.o )
[ 10 of 112] Compiling Control.Monad.Fail.Compat.Repl ( src/Control/Monad/Fail/Compat/Repl.hs, dist/build/Control/Monad/Fail/Compat/Repl.o )
[ 11 of 112] Compiling Control.Monad.IO.Class.Compat ( src/Control/Monad/IO/Class/Compat.hs, dist/build/Control/Monad/IO/Class/Compat.o )
[ 12 of 112] Compiling Control.Monad.IO.Class.Compat.Repl ( src/Control/Monad/IO/Class/Compat/Repl.hs, dist/build/Control/Monad/IO/Class/Compat/Repl.o )
[ 13 of 112] Compiling Control.Monad.ST.Lazy.Unsafe.Compat ( src/Control/Monad/ST/Lazy/Unsafe/Compat.hs, dist/build/Control/Monad/ST/Lazy/Unsafe/Compat.o )
[ 14 of 112] Compiling Control.Monad.ST.Lazy.Unsafe.Compat.Repl ( src/Control/Monad/ST/Lazy/Unsafe/Compat/Repl.hs, dist/build/Control/Monad/ST/Lazy/Unsafe/Compat/Repl.o )
[ 15 of 112] Compiling Control.Monad.ST.Unsafe.Compat ( src/Control/Monad/ST/Unsafe/Compat.hs, dist/build/Control/Monad/ST/Unsafe/Compat.o )
[ 16 of 112] Compiling Control.Monad.ST.Unsafe.Compat.Repl ( src/Control/Monad/ST/Unsafe/Compat/Repl.hs, dist/build/Control/Monad/ST/Unsafe/Compat/Repl.o )
[ 17 of 112] Compiling Data.Bifoldable.Compat ( src/Data/Bifoldable/Compat.hs, dist/build/Data/Bifoldable/Compat.o )
[ 18 of 112] Compiling Data.Bifoldable.Compat.Repl ( src/Data/Bifoldable/Compat/Repl.hs, dist/build/Data/Bifoldable/Compat/Repl.o )
[ 19 of 112] Compiling Data.Bifunctor.Compat ( src/Data/Bifunctor/Compat.hs, dist/build/Data/Bifunctor/Compat.o )
[ 20 of 112] Compiling Data.Bifunctor.Compat.Repl ( src/Data/Bifunctor/Compat/Repl.hs, dist/build/Data/Bifunctor/Compat/Repl.o )
[ 21 of 112] Compiling Data.Bitraversable.Compat ( src/Data/Bitraversable/Compat.hs, dist/build/Data/Bitraversable/Compat.o )
[ 22 of 112] Compiling Data.Bitraversable.Compat.Repl ( src/Data/Bitraversable/Compat/Repl.hs, dist/build/Data/Bitraversable/Compat/Repl.o )
[ 23 of 112] Compiling Data.Bits.Compat ( src/Data/Bits/Compat.hs, dist/build/Data/Bits/Compat.o )
[ 24 of 112] Compiling Data.Bits.Compat.Repl ( src/Data/Bits/Compat/Repl.hs, dist/build/Data/Bits/Compat/Repl.o )
[ 25 of 112] Compiling Data.Bool.Compat ( src/Data/Bool/Compat.hs, dist/build/Data/Bool/Compat.o )
[ 26 of 112] Compiling Data.Bool.Compat.Repl ( src/Data/Bool/Compat/Repl.hs, dist/build/Data/Bool/Compat/Repl.o )
[ 27 of 112] Compiling Data.Complex.Compat ( src/Data/Complex/Compat.hs, dist/build/Data/Complex/Compat.o )
[ 28 of 112] Compiling Data.Complex.Compat.Repl ( src/Data/Complex/Compat/Repl.hs, dist/build/Data/Complex/Compat/Repl.o )
[ 29 of 112] Compiling Data.Either.Compat ( src/Data/Either/Compat.hs, dist/build/Data/Either/Compat.o )
[ 30 of 112] Compiling Data.Either.Compat.Repl ( src/Data/Either/Compat/Repl.hs, dist/build/Data/Either/Compat/Repl.o )
[ 31 of 112] Compiling Data.Foldable.Compat ( src/Data/Foldable/Compat.hs, dist/build/Data/Foldable/Compat.o )
[ 32 of 112] Compiling Data.Foldable.Compat.Repl ( src/Data/Foldable/Compat/Repl.hs, dist/build/Data/Foldable/Compat/Repl.o )
[ 33 of 112] Compiling Data.Function.Compat ( src/Data/Function/Compat.hs, dist/build/Data/Function/Compat.o )
[ 34 of 112] Compiling Data.Function.Compat.Repl ( src/Data/Function/Compat/Repl.hs, dist/build/Data/Function/Compat/Repl.o )
[ 35 of 112] Compiling Data.Functor.Compat ( src/Data/Functor/Compat.hs, dist/build/Data/Functor/Compat.o )
[ 36 of 112] Compiling Data.Functor.Compat.Repl ( src/Data/Functor/Compat/Repl.hs, dist/build/Data/Functor/Compat/Repl.o )
[ 37 of 112] Compiling Data.Functor.Compose.Compat ( src/Data/Functor/Compose/Compat.hs, dist/build/Data/Functor/Compose/Compat.o )
[ 38 of 112] Compiling Data.Functor.Compose.Compat.Repl ( src/Data/Functor/Compose/Compat/Repl.hs, dist/build/Data/Functor/Compose/Compat/Repl.o )
[ 39 of 112] Compiling Data.Functor.Const.Compat ( src/Data/Functor/Const/Compat.hs, dist/build/Data/Functor/Const/Compat.o )
[ 40 of 112] Compiling Data.Functor.Const.Compat.Repl ( src/Data/Functor/Const/Compat/Repl.hs, dist/build/Data/Functor/Const/Compat/Repl.o )
[ 41 of 112] Compiling Data.Functor.Contravariant.Compat ( src/Data/Functor/Contravariant/Compat.hs, dist/build/Data/Functor/Contravariant/Compat.o )
[ 42 of 112] Compiling Data.Functor.Contravariant.Compat.Repl ( src/Data/Functor/Contravariant/Compat/Repl.hs, dist/build/Data/Functor/Contravariant/Compat/Repl.o )
[ 43 of 112] Compiling Data.Functor.Identity.Compat ( src/Data/Functor/Identity/Compat.hs, dist/build/Data/Functor/Identity/Compat.o )
[ 44 of 112] Compiling Data.Functor.Identity.Compat.Repl ( src/Data/Functor/Identity/Compat/Repl.hs, dist/build/Data/Functor/Identity/Compat/Repl.o )
[ 45 of 112] Compiling Data.Functor.Product.Compat ( src/Data/Functor/Product/Compat.hs, dist/build/Data/Functor/Product/Compat.o )
[ 46 of 112] Compiling Data.Functor.Product.Compat.Repl ( src/Data/Functor/Product/Compat/Repl.hs, dist/build/Data/Functor/Product/Compat/Repl.o )
[ 47 of 112] Compiling Data.Functor.Sum.Compat ( src/Data/Functor/Sum/Compat.hs, dist/build/Data/Functor/Sum/Compat.o )
[ 48 of 112] Compiling Data.Functor.Sum.Compat.Repl ( src/Data/Functor/Sum/Compat/Repl.hs, dist/build/Data/Functor/Sum/Compat/Repl.o )
[ 49 of 112] Compiling Data.IORef.Compat ( src/Data/IORef/Compat.hs, dist/build/Data/IORef/Compat.o )
[ 50 of 112] Compiling Data.IORef.Compat.Repl ( src/Data/IORef/Compat/Repl.hs, dist/build/Data/IORef/Compat/Repl.o )
[ 51 of 112] Compiling Data.List.Compat ( src/Data/List/Compat.hs, dist/build/Data/List/Compat.o )
[ 52 of 112] Compiling Data.List.Compat.Repl ( src/Data/List/Compat/Repl.hs, dist/build/Data/List/Compat/Repl.o )
[ 53 of 112] Compiling Data.List.NonEmpty.Compat ( src/Data/List/NonEmpty/Compat.hs, dist/build/Data/List/NonEmpty/Compat.o )
[ 54 of 112] Compiling Data.List.NonEmpty.Compat.Repl ( src/Data/List/NonEmpty/Compat/Repl.hs, dist/build/Data/List/NonEmpty/Compat/Repl.o )
[ 55 of 112] Compiling Data.Monoid.Compat ( src/Data/Monoid/Compat.hs, dist/build/Data/Monoid/Compat.o )
[ 56 of 112] Compiling Data.Monoid.Compat.Repl ( src/Data/Monoid/Compat/Repl.hs, dist/build/Data/Monoid/Compat/Repl.o )
[ 57 of 112] Compiling Data.Proxy.Compat ( src/Data/Proxy/Compat.hs, dist/build/Data/Proxy/Compat.o )
[ 58 of 112] Compiling Data.Proxy.Compat.Repl ( src/Data/Proxy/Compat/Repl.hs, dist/build/Data/Proxy/Compat/Repl.o )
[ 59 of 112] Compiling Data.Ratio.Compat ( src/Data/Ratio/Compat.hs, dist/build/Data/Ratio/Compat.o )
[ 60 of 112] Compiling Data.Ratio.Compat.Repl ( src/Data/Ratio/Compat/Repl.hs, dist/build/Data/Ratio/Compat/Repl.o )
[ 61 of 112] Compiling Data.STRef.Compat ( src/Data/STRef/Compat.hs, dist/build/Data/STRef/Compat.o )
[ 62 of 112] Compiling Data.STRef.Compat.Repl ( src/Data/STRef/Compat/Repl.hs, dist/build/Data/STRef/Compat/Repl.o )
[ 63 of 112] Compiling Data.Semigroup.Compat ( src/Data/Semigroup/Compat.hs, dist/build/Data/Semigroup/Compat.o )
[ 64 of 112] Compiling Data.Semigroup.Compat.Repl ( src/Data/Semigroup/Compat/Repl.hs, dist/build/Data/Semigroup/Compat/Repl.o )
[ 65 of 112] Compiling Data.String.Compat ( src/Data/String/Compat.hs, dist/build/Data/String/Compat.o )
[ 66 of 112] Compiling Data.String.Compat.Repl ( src/Data/String/Compat/Repl.hs, dist/build/Data/String/Compat/Repl.o )
[ 67 of 112] Compiling Data.Type.Coercion.Compat ( src/Data/Type/Coercion/Compat.hs, dist/build/Data/Type/Coercion/Compat.o )
[ 68 of 112] Compiling Data.Type.Coercion.Compat.Repl ( src/Data/Type/Coercion/Compat/Repl.hs, dist/build/Data/Type/Coercion/Compat/Repl.o )
[ 69 of 112] Compiling Data.Version.Compat ( src/Data/Version/Compat.hs, dist/build/Data/Version/Compat.o )
[ 70 of 112] Compiling Data.Version.Compat.Repl ( src/Data/Version/Compat/Repl.hs, dist/build/Data/Version/Compat/Repl.o )
[ 71 of 112] Compiling Data.Void.Compat ( src/Data/Void/Compat.hs, dist/build/Data/Void/Compat.o )
[ 72 of 112] Compiling Data.Void.Compat.Repl ( src/Data/Void/Compat/Repl.hs, dist/build/Data/Void/Compat/Repl.o )
[ 73 of 112] Compiling Data.Word.Compat ( src/Data/Word/Compat.hs, dist/build/Data/Word/Compat.o )
[ 74 of 112] Compiling Data.Word.Compat.Repl ( src/Data/Word/Compat/Repl.hs, dist/build/Data/Word/Compat/Repl.o )
[ 75 of 112] Compiling Debug.Trace.Compat ( src/Debug/Trace/Compat.hs, dist/build/Debug/Trace/Compat.o )
[ 76 of 112] Compiling Debug.Trace.Compat.Repl ( src/Debug/Trace/Compat/Repl.hs, dist/build/Debug/Trace/Compat/Repl.o )
[ 77 of 112] Compiling Foreign.ForeignPtr.Compat ( src/Foreign/ForeignPtr/Compat.hs, dist/build/Foreign/ForeignPtr/Compat.o )
[ 78 of 112] Compiling Foreign.ForeignPtr.Compat.Repl ( src/Foreign/ForeignPtr/Compat/Repl.hs, dist/build/Foreign/ForeignPtr/Compat/Repl.o )
[ 79 of 112] Compiling Foreign.ForeignPtr.Safe.Compat ( src/Foreign/ForeignPtr/Safe/Compat.hs, dist/build/Foreign/ForeignPtr/Safe/Compat.o )
[ 80 of 112] Compiling Foreign.ForeignPtr.Safe.Compat.Repl ( src/Foreign/ForeignPtr/Safe/Compat/Repl.hs, dist/build/Foreign/ForeignPtr/Safe/Compat/Repl.o )
[ 81 of 112] Compiling Foreign.ForeignPtr.Unsafe.Compat ( src/Foreign/ForeignPtr/Unsafe/Compat.hs, dist/build/Foreign/ForeignPtr/Unsafe/Compat.o )
[ 82 of 112] Compiling Foreign.ForeignPtr.Unsafe.Compat.Repl ( src/Foreign/ForeignPtr/Unsafe/Compat/Repl.hs, dist/build/Foreign/ForeignPtr/Unsafe/Compat/Repl.o )
[ 83 of 112] Compiling Foreign.Marshal.Alloc.Compat ( src/Foreign/Marshal/Alloc/Compat.hs, dist/build/Foreign/Marshal/Alloc/Compat.o )
[ 84 of 112] Compiling Foreign.Marshal.Alloc.Compat.Repl ( src/Foreign/Marshal/Alloc/Compat/Repl.hs, dist/build/Foreign/Marshal/Alloc/Compat/Repl.o )
[ 85 of 112] Compiling Foreign.Marshal.Array.Compat ( src/Foreign/Marshal/Array/Compat.hs, dist/build/Foreign/Marshal/Array/Compat.o )
[ 86 of 112] Compiling Foreign.Marshal.Array.Compat.Repl ( src/Foreign/Marshal/Array/Compat/Repl.hs, dist/build/Foreign/Marshal/Array/Compat/Repl.o )
[ 87 of 112] Compiling Foreign.Marshal.Safe.Compat ( src/Foreign/Marshal/Safe/Compat.hs, dist/build/Foreign/Marshal/Safe/Compat.o )
[ 88 of 112] Compiling Foreign.Marshal.Safe.Compat.Repl ( src/Foreign/Marshal/Safe/Compat/Repl.hs, dist/build/Foreign/Marshal/Safe/Compat/Repl.o )
[ 89 of 112] Compiling Foreign.Marshal.Unsafe.Compat ( src/Foreign/Marshal/Unsafe/Compat.hs, dist/build/Foreign/Marshal/Unsafe/Compat.o )
[ 90 of 112] Compiling Foreign.Marshal.Unsafe.Compat.Repl ( src/Foreign/Marshal/Unsafe/Compat/Repl.hs, dist/build/Foreign/Marshal/Unsafe/Compat/Repl.o )
[ 91 of 112] Compiling Foreign.Marshal.Utils.Compat ( src/Foreign/Marshal/Utils/Compat.hs, dist/build/Foreign/Marshal/Utils/Compat.o )
[ 92 of 112] Compiling Foreign.Marshal.Compat ( src/Foreign/Marshal/Compat.hs, dist/build/Foreign/Marshal/Compat.o )
[ 93 of 112] Compiling Foreign.Marshal.Compat.Repl ( src/Foreign/Marshal/Compat/Repl.hs, dist/build/Foreign/Marshal/Compat/Repl.o )
[ 94 of 112] Compiling Foreign.Compat   ( src/Foreign/Compat.hs, dist/build/Foreign/Compat.o )
[ 95 of 112] Compiling Foreign.Compat.Repl ( src/Foreign/Compat/Repl.hs, dist/build/Foreign/Compat/Repl.o )
[ 96 of 112] Compiling Foreign.Marshal.Utils.Compat.Repl ( src/Foreign/Marshal/Utils/Compat/Repl.hs, dist/build/Foreign/Marshal/Utils/Compat/Repl.o )
[ 97 of 112] Compiling Numeric.Compat   ( src/Numeric/Compat.hs, dist/build/Numeric/Compat.o )
[ 98 of 112] Compiling Numeric.Compat.Repl ( src/Numeric/Compat/Repl.hs, dist/build/Numeric/Compat/Repl.o )
[ 99 of 112] Compiling Numeric.Natural.Compat ( src/Numeric/Natural/Compat.hs, dist/build/Numeric/Natural/Compat.o )
[100 of 112] Compiling Numeric.Natural.Compat.Repl ( src/Numeric/Natural/Compat/Repl.hs, dist/build/Numeric/Natural/Compat/Repl.o )
[101 of 112] Compiling Prelude.Compat   ( src/Prelude/Compat.hs, dist/build/Prelude/Compat.o )
[102 of 112] Compiling Prelude.Compat.Repl ( src/Prelude/Compat/Repl.hs, dist/build/Prelude/Compat/Repl.o )
[103 of 112] Compiling System.Environment.Compat ( src/System/Environment/Compat.hs, dist/build/System/Environment/Compat.o )
[104 of 112] Compiling System.Environment.Compat.Repl ( src/System/Environment/Compat/Repl.hs, dist/build/System/Environment/Compat/Repl.o )
[105 of 112] Compiling System.Exit.Compat ( src/System/Exit/Compat.hs, dist/build/System/Exit/Compat.o )
[106 of 112] Compiling System.Exit.Compat.Repl ( src/System/Exit/Compat/Repl.hs, dist/build/System/Exit/Compat/Repl.o )
[107 of 112] Compiling System.IO.Unsafe.Compat ( src/System/IO/Unsafe/Compat.hs, dist/build/System/IO/Unsafe/Compat.o )
[108 of 112] Compiling System.IO.Unsafe.Compat.Repl ( src/System/IO/Unsafe/Compat/Repl.hs, dist/build/System/IO/Unsafe/Compat/Repl.o )
[109 of 112] Compiling Text.Read.Compat ( src/Text/Read/Compat.hs, dist/build/Text/Read/Compat.o )
[110 of 112] Compiling Text.Read.Compat.Repl ( src/Text/Read/Compat/Repl.hs, dist/build/Text/Read/Compat/Repl.o )
[111 of 112] Compiling Type.Reflection.Compat ( src/Type/Reflection/Compat.hs, dist/build/Type/Reflection/Compat.o )
[112 of 112] Compiling Type.Reflection.Compat.Repl ( src/Type/Reflection/Compat/Repl.hs, dist/build/Type/Reflection/Compat/Repl.o )
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__TMC_END__' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

Failed to build colour-2.3.4.
Build log (
/root/.cabal/logs/ghc-8.6.3/colour-2.3.4-9875af95a23db6c0040a1d671bc95e43754ed36f818e9c9b185b736d73e68b44.log
):
Configuring library for colour-2.3.4..
Preprocessing library for colour-2.3.4..
Building library for colour-2.3.4..
[ 1 of 14] Compiling Data.Colour.CIE.Chromaticity ( Data/Colour/CIE/Chromaticity.hs, dist/build/Data/Colour/CIE/Chromaticity.o )
[ 2 of 14] Compiling Data.Colour.CIE.Illuminant ( Data/Colour/CIE/Illuminant.hs, dist/build/Data/Colour/CIE/Illuminant.o )
[ 3 of 14] Compiling Data.Colour.Chan ( Data/Colour/Chan.hs, dist/build/Data/Colour/Chan.o )
[ 4 of 14] Compiling Data.Colour.Internal ( Data/Colour/Internal.hs, dist/build/Data/Colour/Internal.o )
[ 5 of 14] Compiling Data.Colour.Matrix ( Data/Colour/Matrix.hs, dist/build/Data/Colour/Matrix.o )
[ 6 of 14] Compiling Data.Colour.RGB ( Data/Colour/RGB.hs, dist/build/Data/Colour/RGB.o )
[ 7 of 14] Compiling Data.Colour.RGBSpace.HSL ( Data/Colour/RGBSpace/HSL.hs, dist/build/Data/Colour/RGBSpace/HSL.o )
[ 8 of 14] Compiling Data.Colour.RGBSpace.HSV ( Data/Colour/RGBSpace/HSV.hs, dist/build/Data/Colour/RGBSpace/HSV.o )
[ 9 of 14] Compiling Data.Colour.SRGB.Linear ( Data/Colour/SRGB/Linear.hs, dist/build/Data/Colour/SRGB/Linear.o )
[10 of 14] Compiling Data.Colour.RGBSpace ( Data/Colour/RGBSpace.hs, dist/build/Data/Colour/RGBSpace.o )
[11 of 14] Compiling Data.Colour.SRGB ( Data/Colour/SRGB.hs, dist/build/Data/Colour/SRGB.o )
[12 of 14] Compiling Data.Colour ( Data/Colour.hs, dist/build/Data/Colour.o )
[13 of 14] Compiling Data.Colour.Names ( Data/Colour/Names.hs, dist/build/Data/Colour/Names.o )
[14 of 14] Compiling Data.Colour.CIE ( Data/Colour/CIE.hs, dist/build/Data/Colour/CIE.o )
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: requires dynamic R_X86_64_32 reloc against 'TMC_END' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
gcc' failed in phase Linker'. (Exit code: 1)

Failed to build containers-0.5.11.0.
Build log (
/root/.cabal/logs/ghc-8.6.3/containers-0.5.11.0-b8bb6e3b2e1e0428564ba7f198225719fe796dcde5df663eb9fa38dc977e5eef.log
):
Configuring library for containers-0.5.11.0..
Preprocessing library for containers-0.5.11.0..
Building library for containers-0.5.11.0..
[ 1 of 35] Compiling Utils.Containers.Internal.BitUtil ( Utils/Containers/Internal/BitUtil.hs, dist/build/Utils/Containers/Internal/BitUtil.o )
[ 2 of 35] Compiling Utils.Containers.Internal.BitQueue ( Utils/Containers/Internal/BitQueue.hs, dist/build/Utils/Containers/Internal/BitQueue.o )
[ 3 of 35] Compiling Utils.Containers.Internal.PtrEquality ( Utils/Containers/Internal/PtrEquality.hs, dist/build/Utils/Containers/Internal/PtrEquality.o )
[ 4 of 35] Compiling Utils.Containers.Internal.State ( Utils/Containers/Internal/State.hs, dist/build/Utils/Containers/Internal/State.o )
[ 5 of 35] Compiling Utils.Containers.Internal.StrictFold ( Utils/Containers/Internal/StrictFold.hs, dist/build/Utils/Containers/Internal/StrictFold.o )
[ 6 of 35] Compiling Utils.Containers.Internal.StrictMaybe ( Utils/Containers/Internal/StrictMaybe.hs, dist/build/Utils/Containers/Internal/StrictMaybe.o )
[ 7 of 35] Compiling Utils.Containers.Internal.StrictPair ( Utils/Containers/Internal/StrictPair.hs, dist/build/Utils/Containers/Internal/StrictPair.o )
[ 8 of 35] Compiling Data.Set.Internal ( Data/Set/Internal.hs, dist/build/Data/Set/Internal.o )
[ 9 of 35] Compiling Data.Set ( Data/Set.hs, dist/build/Data/Set.o )
[10 of 35] Compiling Data.Sequence.Internal ( Data/Sequence/Internal.hs, dist/build/Data/Sequence/Internal.o )
[11 of 35] Compiling Data.Sequence.Internal.Sorting ( Data/Sequence/Internal/Sorting.hs, dist/build/Data/Sequence/Internal/Sorting.o )
[12 of 35] Compiling Data.Sequence ( Data/Sequence.hs, dist/build/Data/Sequence.o )
[13 of 35] Compiling Data.Tree ( Data/Tree.hs, dist/build/Data/Tree.o )
[14 of 35] Compiling Data.Graph ( Data/Graph.hs, dist/build/Data/Graph.o )
[15 of 35] Compiling Data.Map.Internal ( Data/Map/Internal.hs, dist/build/Data/Map/Internal.o )
[16 of 35] Compiling Data.Map.Merge.Lazy ( Data/Map/Merge/Lazy.hs, dist/build/Data/Map/Merge/Lazy.o )
[17 of 35] Compiling Data.Map.Lazy.Merge ( Data/Map/Lazy/Merge.hs, dist/build/Data/Map/Lazy/Merge.o )
[18 of 35] Compiling Data.Map.Internal.Debug ( Data/Map/Internal/Debug.hs, dist/build/Data/Map/Internal/Debug.o )
[19 of 35] Compiling Data.Map.Internal.DeprecatedShowTree ( Data/Map/Internal/DeprecatedShowTree.hs, dist/build/Data/Map/Internal/DeprecatedShowTree.o )
[20 of 35] Compiling Data.Map.Strict.Internal ( Data/Map/Strict/Internal.hs, dist/build/Data/Map/Strict/Internal.o )
[21 of 35] Compiling Data.Map.Strict ( Data/Map/Strict.hs, dist/build/Data/Map/Strict.o )
[22 of 35] Compiling Data.Map.Merge.Strict ( Data/Map/Merge/Strict.hs, dist/build/Data/Map/Merge/Strict.o )
[23 of 35] Compiling Data.Map.Strict.Merge ( Data/Map/Strict/Merge.hs, dist/build/Data/Map/Strict/Merge.o )
[24 of 35] Compiling Data.Map.Lazy ( Data/Map/Lazy.hs, dist/build/Data/Map/Lazy.o )
[25 of 35] Compiling Data.Map ( Data/Map.hs, dist/build/Data/Map.o )
[26 of 35] Compiling Data.IntSet.Internal ( Data/IntSet/Internal.hs, dist/build/Data/IntSet/Internal.o )
[27 of 35] Compiling Data.IntSet ( Data/IntSet.hs, dist/build/Data/IntSet.o )
[28 of 35] Compiling Data.IntMap.Internal ( Data/IntMap/Internal.hs, dist/build/Data/IntMap/Internal.o )
[29 of 35] Compiling Data.IntMap.Merge.Strict ( Data/IntMap/Merge/Strict.hs, dist/build/Data/IntMap/Merge/Strict.o )
[30 of 35] Compiling Data.IntMap.Merge.Lazy ( Data/IntMap/Merge/Lazy.hs, dist/build/Data/IntMap/Merge/Lazy.o )
[31 of 35] Compiling Data.IntMap.Internal.DeprecatedDebug ( Data/IntMap/Internal/DeprecatedDebug.hs, dist/build/Data/IntMap/Internal/DeprecatedDebug.o )
[32 of 35] Compiling Data.IntMap.Strict ( Data/IntMap/Strict.hs, dist/build/Data/IntMap/Strict.o )
[33 of 35] Compiling Data.IntMap.Lazy ( Data/IntMap/Lazy.hs, dist/build/Data/IntMap/Lazy.o )
[34 of 35] Compiling Data.IntMap ( Data/IntMap.hs, dist/build/Data/IntMap.o )
[35 of 35] Compiling Data.IntMap.Internal.Debug ( Data/IntMap/Internal/Debug.hs, dist/build/Data/IntMap/Internal/Debug.o )
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: requires dynamic R_X86_64_32 reloc against 'TMC_END' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
gcc' failed in phase Linker'. (Exit code: 1)

Failed to build dlist-0.8.0.5.
Build log (
/root/.cabal/logs/ghc-8.6.3/dlist-0.8.0.5-e7cb8aded1ab336d5b6ec2b6ac3f21944391aa15a32746136d6b4e1295b773d7.log
):
Configuring library for dlist-0.8.0.5..
Preprocessing library for dlist-0.8.0.5..
Building library for dlist-0.8.0.5..
[1 of 1] Compiling Data.DList ( Data/DList.hs, dist/build/Data/DList.o )
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: requires dynamic R_X86_64_32 reloc against 'TMC_END' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
gcc' failed in phase Linker'. (Exit code: 1)

Failed to build random-1.1.
Build log (
/root/.cabal/logs/ghc-8.6.3/random-1.1-b31a6f9f21ceb46a656aaadd06b6feacdd6ada89e0f9534d355c1f93b059cda4.log
):
Warning: random.cabal:15:2: Tabs used as indentation at 15:2, 16:2, 17:2
Configuring library for random-1.1..
Preprocessing library for random-1.1..
Building library for random-1.1..
[1 of 1] Compiling System.Random ( System/Random.hs, dist/build/System/Random.o )

System/Random.hs:43:1: warning: [-Wtabs]
Tab character found here, and in 74 further locations.
Please use spaces instead.
|
43 | (
| ^^^^^^^^
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: requires dynamic R_X86_64_32 reloc against 'TMC_END' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
gcc' failed in phase Linker'. (Exit code: 1)

Failed to build transformers-compat-0.6.2.
Build log (
/root/.cabal/logs/ghc-8.6.3/transformers-compat-0.6.2-c757024fa447c63bacc423732c0f19b609550d4010c1166a49299d7800b64862.log
):
Configuring library for transformers-compat-0.6.2..
Preprocessing library for transformers-compat-0.6.2..
Building library for transformers-compat-0.6.2..
[1 of 4] Compiling Control.Monad.Trans.Instances ( src/Control/Monad/Trans/Instances.hs, dist/build/Control/Monad/Trans/Instances.o )
[2 of 4] Compiling Data.Functor.Classes.Generic.Internal ( generics/Data/Functor/Classes/Generic/Internal.hs, dist/build/Data/Functor/Classes/Generic/Internal.o )
[3 of 4] Compiling Data.Functor.Classes.Generic ( generics/Data/Functor/Classes/Generic.hs, dist/build/Data/Functor/Classes/Generic.o )
[4 of 4] Compiling Paths_transformers_compat ( dist/build/autogen/Paths_transformers_compat.hs, dist/build/Paths_transformers_compat.o )
/usr/bin/ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: requires dynamic R_X86_64_32 reloc against 'TMC_END' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
gcc' failed in phase Linker'. (Exit code: 1)
cabal: Failed to build base-compat-0.10.5 (which is required by exe:erd from
erd-0.1.3.0). See the build log above for details.
Failed to build colour-2.3.4 (which is required by exe:erd from erd-0.1.3.0).
See the build log above for details.
Failed to build containers-0.5.11.0 (which is required by exe:erd from
erd-0.1.3.0). See the build log above for details.
Failed to build dlist-0.8.0.5 (which is required by exe:erd from erd-0.1.3.0).
See the build log above for details.
Failed to build random-1.1 (which is required by exe:erd from erd-0.1.3.0).
See the build log above for details.
Failed to build transformers-compat-0.6.2 (which is required by exe:erd from
erd-0.1.3.0). See the build log above for details.

The command '/bin/sh -c cabal new-configure --disable-executable-dynamic --disable-shared --ghc-option=-optl=-static && cabal new-build' returned a non-zero code: 1


Do you know if it's possible ? Am I missing something ?

Thanks for your help ๐Ÿ‘

Keys not formatted

Hi there,

I have just installed on linux via cabal install erd

When I run this:

$ ~/.cabal/bin/erd -i simple.er -o simple.png

I get this output:

simple

Note the two keys are neither underlined nor italic.

Any ideas?

Erd configuration file in ~/.erd.yaml

To mitigate the increasing amount of command-line arguments that describe formatting options of the resulted output. This is a proposal to have a configuration file that stores such descriptions. There would be priority decided between command-line and config-file provided options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.