BurntSushi / erd

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.
The Unlicense
1.79k stars 154 forks source link

IE (crow's foot) notation for cardinalities of relations (#92, #33) #100

Closed kukimik closed 3 years ago

kukimik commented 3 years ago

This adds support for the Information Engineering notation for cardinalities of relations (also known as Martin's notation, crow's foot notation and under other names). See e.g. https://vertabelo.com/blog/crow-s-foot-notation/. Merging this will close #92 and close #33.

I used the code by @nickolay from https://github.com/BurntSushi/erd/issues/33#issuecomment-485968070.

Along the way I removed Maybe from the fmts, edges, edgePatterns and notations dictionaries in src/Erd/Config.hs. I believe it looks more tidy this way.

I had to expand the rendering part in app/Main.hs. I believe this code would better be moved to src/ (perhaps src/Erd/Render.hs). However, I felt that such refactoring is out of scope for this PR.


I've noticed that there is a changelog.md file in the repo. Should I include a description of the changes in some new "unreleased" section of the file? I'm asking because I've thought that such policy could make preparing the future release easier.

mmzx commented 3 years ago

@kukimik I've briefly went through this PR. It looks nice indeed. Tomorrow I will take a run with it just to see it.

I will update the changelog separately before making a new version on hackage which would include other earlier changes.

mmzx commented 3 years ago

Looks sweet! Thanks a lot again! I will make the changelog reference and so, it shall make a new version shipped to hackage as well!