SQL to ER Diagram
Home › Sequelize

Sequelize to ER Diagram

Paste your Sequelize model definitions and get an interactive ER diagram — tables, columns from DataTypes, and relations from associations.

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

How it works

  1. Copy your Sequelize models (sequelize.define(...) or Model.init(...)).
  2. Paste them into the editor — Sequelize is auto-detected.
  3. Each model becomes a table; associations like belongsTo become relations.
  4. Arrange, hide tables, then export PNG/SVG or share a link.

Example

Sequelize models like this:

const User = sequelize.define('User', {
  email: { type: DataTypes.STRING, unique: true }
});

const Post = sequelize.define('Post', {
  title: DataTypes.STRING
});

Post.belongsTo(User);

…renders User and Post with a relation between them. Try it with your own →

Guide

Sequelize models can be defined three ways — sequelize.define('User', {...}), class User extends Model {} + User.init({...}), or the old sequelize.import — and this page reads all of them as plain text. Attribute names come from the object keys, types from the DataTypes values, and primaryKey: true, unique: true, allowNull: false are picked up as key/constraint badges.

Relations are drawn from your associations: Post.belongsTo(User) and User.hasMany(Post) both produce the same edge (the foreign key is what matters), belongsToMany through a model renders as many-to-many via the join table, and alias options like { as: 'author', foreignKey: 'author_id' } are respected when naming the edge.

An alternative that captures the real database: call await sequelize.sync({ logging: console.log }) once against a scratch database and paste the logged CREATE TABLE SQL instead. That shows exactly what Sequelize would build, including the join tables it creates implicitly for belongsToMany.

Why use it

SequelizePrismaSQLAlchemySQL

FAQ

How do I diagram Sequelize models?

Paste your sequelize.define or Model.init definitions. Columns come from DataTypes and relations from associations like belongsTo / hasMany.

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