SQL to ER Diagram
Home › SQLAlchemy

SQLAlchemy to ER Diagram

Paste your SQLAlchemy declarative models and get an interactive ER diagram — tables from __tablename__, columns, and relations from ForeignKey.

Open the diagram tool →
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link

How it works

  1. Copy your SQLAlchemy model classes (declarative Base / db.Model).
  2. Paste them into the editor — SQLAlchemy is auto-detected.
  3. Each model becomes a table; ForeignKey("table.col") becomes a relation.
  4. Arrange, hide tables, then export PNG/SVG or share a link.

Example

SQLAlchemy models like this:

class User(Base):
    __tablename__ = "users"
    id = Column(Integer, primary_key=True)
    email = Column(String, unique=True)

class Post(Base):
    __tablename__ = "posts"
    id = Column(Integer, primary_key=True)
    author_id = Column(Integer, ForeignKey("users.id"))

…renders two tables with a relation from posts.author_idusers.id. Try it with your own →

Why use it

SQLAlchemyPrismaSequelizeSQL

FAQ

How do I visualize SQLAlchemy models?

Paste your declarative model classes. Tables come from __tablename__, columns from Column(...), and relations from ForeignKey.

Do I need to run my app?

No — it reads the model source directly in the browser, nothing is imported or executed.

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.

Related