Getting Started
DDL to ER Diagram
Creating ER diagrams from foreign key references in DDL
Automatic Foreign Key Detection in Action
See how Datascale instantly transforms your SQL into visual ER diagrams

Drop your DDL into Datascale, and watch it automatically detect relationships and generate interactive ER diagrams. Here's how:
Input: Raw DDL
Noted: Some DDL syntax might be not supported. If you don't see the diagram result, please simplify complex settings in your schema to include only column names and data types. Learn more SQL CREATE TABLE Statement:
Output: Interactive ER Diagram
Datascale automatically:
✅ Detects the foreign key:
wallets.user_id → users.id
✅ Maps the relationship: Visual connection between tables
✅ Identifies constraints:
UNIQUE
,NOT NULL
,CASCADE
behaviors✅ Color-codes tables: Visual organization for better clarity
Key Benefits
🚀 Instant Visualization: No manual diagram creation 🔍 Relationship Discovery: Catches foreign keys you might miss 👥 Team Collaboration: Share visual schemas instantly 📋 Living Documentation: Diagrams stay synced with your code
What Gets Detected
From your DDL, Datascale automatically identifies:
Primary keys (
id UUID PRIMARY KEY
)Foreign key references (
REFERENCES users(id)
)Cascade behaviors (
ON DELETE CASCADE
)Column constraints (
UNIQUE
,NOT NULL
)Data types and defaults
Try It Yourself
Paste your DDL statements
Watch the automatic ER diagram generation
Explore relationships visually
Collaborate with your team
Example:
