SQL to ER Diagram
Home › SQL to DBML

SQL to DBML

Paste your SQL CREATE TABLE statements and export them as DBML — ready for dbdiagram.io and other DBML tools — while you preview the live ER diagram.

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

How it works

  1. Paste your SQL schema into the editor (PostgreSQL, MySQL, SQLite, SQL Server, Oracle…).
  2. The diagram renders instantly so you can confirm the tables and relations.
  3. Click Export → DBML and copy the result.
  4. Paste it into dbdiagram.io or any DBML-based workflow.

Example

This SQL:

CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email TEXT UNIQUE
);
CREATE TABLE posts (
  id SERIAL PRIMARY KEY,
  user_id INT REFERENCES users(id)
);

…exports as this DBML:

Table users {
  id serial [pk]
  email text [unique]
}
Table posts {
  id serial [pk]
  user_id int
}
Ref: posts.user_id > users.id

Copy it from Export → DBML. Try it with your own →

Why use it

SQL → DBMLSQL → MermaidSQL → PlantUMLPNG / SVG

FAQ

How do I convert SQL to DBML?

Paste your CREATE TABLE statements, then click Export → DBML and copy the output. Tables become Table blocks and foreign keys become Ref: lines.

Is this a free dbdiagram importer?

Yes — convert SQL to DBML for free and paste it straight into dbdiagram.io, with no account.

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