finds.dev← search

// the find

BurntSushi/erd

★ 1,865 · Haskell · Unlicense · updated Sep 2024

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

erd is a Haskell CLI that parses a small plain-text DSL describing tables, columns, and relationships, then renders it as an ER diagram via GraphViz. It's for developers who want their schema diagrams in a text file they can diff and version alongside the code, rather than drawn in a GUI tool.

The text format is genuinely diffable and git-friendly, which is the main reason to pick this over a GUI ER tool. Output isn't locked in — you can target svg/png/pdf/plain text directly, or dump raw dot and hand it to something else for further tweaking. Distribution is flexible: MacPorts one-liner, a prebuilt Docker image, or Stack/Cabal from source, so you're not forced into the Haskell toolchain if you just want the binary.

It's a single executable with no library/API — any integration into a docs pipeline means shelling out and parsing stdout/files, not calling into it as a dependency. The DSL has no real validation: misspelling an entity name in a relationship line silently creates a new orphan entity instead of erroring, which is an easy mistake to miss in a larger schema. Formatting is intentionally minimal by the author's own stated philosophy, so once a schema gets non-trivial, you're at the mercy of GraphViz's default layout with little recourse short of hand-editing the dot output. Last push was September 2024 with a Haskell+Stack/GraphViz toolchain, so expect a bit of setup friction and don't count on fast turnaround for issues.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →