TypeORM to ER Diagram
Visualize your TypeORM entities as an interactive ER diagram. The most reliable path is to let TypeORM emit the SQL for your entities and paste that — every column type and relation comes through exactly.
Open the diagram tool →How it works
- Generate the schema SQL from your entities: run a migration with
typeorm migration:generate, or log the SQL fromsynchronize. - Copy the
CREATE TABLE/ALTER TABLEstatements. - Paste them into the editor — the SQL is parsed and tables + foreign keys are drawn.
- Arrange, hide tables, then export PNG/SVG or convert to Mermaid/DBML.
Example
TypeORM generates SQL like this from your entities:
CREATE TABLE "user" (
"id" SERIAL PRIMARY KEY,
"email" varchar NOT NULL
);
CREATE TABLE "post" (
"id" SERIAL PRIMARY KEY,
"authorId" integer REFERENCES "user"("id")
);
…renders two tables with a relation from post.authorId → user.id. Try it with your own →
Guide
TypeORM entities are decorators over classes — @Entity(), @PrimaryGeneratedColumn(), @Column(), @ManyToOne(() => User, u => u.posts) — and while this page works from the SQL TypeORM generates, that's the more reliable path anyway: the generated SQL is the ground truth of what's in your database, including column types resolved from your database driver, explicit constraint names, and join tables created by @ManyToMany(() => Tag, tag => tag.posts).
The two easiest ways to get that SQL:
- Migrations:
npx typeorm migration:generate -d ./migrations MyFirstMigration, then paste theCREATE TABLEstatements from the generated file. - Synchronize logging: set
logging: truein your DataSource options (orsynchronize: truein dev) and copy the schema-sync SQL from the console at startup.
Both produce standard Postgres/MySQL DDL with ALTER TABLE … ADD CONSTRAINT foreign keys, which the parser stitches back onto the right tables. NestJS projects work identically — the entities are plain TypeORM under the hood.
Why use it
- Private: everything runs in your browser — nothing is uploaded or stored on a server.
- Exact: generated SQL captures every column type, index and relation.
- Interactive: drag tables, auto-arrange, hide noise, add notes, and manually link columns.
- Export a high-res PNG, vector SVG, or the schema as Mermaid / DBML / PlantUML code.
- Free & open source — no account, no sign-up.
FAQ
How do I get an ER diagram from TypeORM?
Have TypeORM emit the SQL for your entities (via migration:generate or by logging the synchronize SQL), then paste those CREATE TABLE statements here.
Why use the generated SQL instead of the entity files?
The generated SQL is the source of truth for the actual database shape — column types, defaults and foreign keys are all explicit, so the diagram is exact.
Is my schema uploaded anywhere?
No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.
Is it free?
Yes. It is completely free and open source, with no account or sign-up required.