ER diagram from CREATE TABLE
Paste the CREATE TABLE statements of a PostgreSQL or SQL Server schema and get an entity-relationship diagram as a standalone SVG: one box per table with its columns, primary keys, foreign keys and unique columns marked, a line for every foreign key pointing at the parent table, and junction tables tinted. Download it for a README, a design review or a slide. Whole migration scripts are fine: data statements, views and triggers are passed over.
Your DDL is read on the server and forgotten. Nothing is stored, nothing is logged, and no database is contacted: the tool only reads the text. The diagram is drawn in your browser from the SVG it sends back, and the download is made on your machine.
SVG source
Needs your judgment
What the diagram shows
Free API β use it from your own tools
The same engine powers an open API (this page uses it too). No signup, no key, just a rate limit of 60 requests per minute per IP. Handy for a CI job that redraws the schema diagram in your README whenever a migration changes it. The API stores nothing.
curl
curl -X POST https://www.coder000.com/api/v1/er-diagram \
-H "Content-Type: application/json" \
-d '{"input": "CREATE TABLE rooms (id bigint PRIMARY KEY); CREATE TABLE doctors (id bigint PRIMARY KEY, room_id bigint REFERENCES rooms (id));"}' \
| jq -r .output > er-diagram.svg
Uniform response shape: { "output": "β¦", "notes": [...], "warnings": [...] }.
output is the complete SVG file as text (it opens on its own, white background
included), or null when no table was found. Each note and warning carries a
change, an explanation and, where a post teaches the rule, a
link. Send up to 100,000 characters per request.
How it works, and what it cannot do
No AI and no database. A rule-based reader goes through the text for CREATE TABLE, CREATE INDEX and ALTER TABLE β¦ ADD CONSTRAINT statements, in PostgreSQL or SQL Server spelling: [brackets], "quotes", schema prefixes, GO lines and comments are all fine. Each table becomes a box; each foreign key becomes a line from the table that holds it to the table it points at, with the arrowhead on the parent. A table's column in the picture is the longest chain of foreign keys below it, so parents sit on the left and children to their right, and each box is placed as close as it can get to the tables it points at.
It is a quick, honest picture, not a modelling tool. Lines are straight, so on a big schema some cross or pass behind a box; the arrow and the column label tell you where each one goes. The arrow shows direction only: one-to-one and one-to-many look the same, and the notes say which foreign keys are unique. A box lists at most 14 lines, and at most 60 tables are drawn. Views, triggers and functions are not part of the diagram, and a foreign key that points at a table you did not paste is drawn dashed, to a box marked "not in input". SQL Server creates the history table of a system-versioned table by itself, so there is no CREATE TABLE to draw it from, and the notes say so.