Skip to main content

Database Schema & SQL DDL Tool

Runs locally

Inspect SQL DDL tables, generate Mermaid ER diagrams and convert between SQL dialects.

What is Database Schema & SQL DDL Tool?

Draft and inspect SQL `CREATE TABLE` DDL statements, visualize tables, primary keys, and foreign-key relationships, generate Mermaid `erDiagram` markup, and format SQL cleanly.

How to use Database Schema & SQL DDL Tool

  1. Step 1

    Paste CREATE TABLE SQL DDL statements.

  2. Step 2

    Inspect parsed columns, types, constraints, and relationships.

  3. Step 3

    Copy formatted DDL, Mermaid ER diagram code, or TypeScript interfaces.

Features

  • Parses CREATE TABLE columns, PRIMARY KEY, UNIQUE, NOT NULL, and REFERENCES
  • Generates Mermaid `erDiagram` syntax automatically
  • Formats DDL across PostgreSQL, MySQL, and SQLite
  • 100% browser-based

Example

Input

CREATE TABLE users (id INT PRIMARY KEY, email TEXT NOT NULL);

Output

erDiagram
  users {
    INT id PK
    TEXT email
  }

Turns SQL DDL into readable ER diagrams and structured schemas.

Frequently asked questions

Which SQL DDL statements are supported?

Standard CREATE TABLE blocks with inline or table-level PRIMARY KEY and FOREIGN KEY constraints.

Can I export a Mermaid ER diagram?

Yes, switch to the ER Diagram tab to copy Mermaid markup.

Is my database schema uploaded?

No, runs locally in your browser.

Can it format messy DDL?

Yes, uses sql-formatter for PostgreSQL, MySQL, and SQLite.