<aside> 💡 This page is deprecated. Please use https://dbdiagram.io/docs

</aside>

Introduction

dbdiagram.io is a free, simple tool to draw database diagrams (ERDs) by typing DSL code. dbdiagram uses the popular DBML (Database Markup Language).

Basic Functions

dbdiagram syntax: DBML

dbdiagram.io uses DBML as our syntax for defining database. DBML is open-sourced markup language used to define database schema structure. DBML is also developed by the team behind dbdiagram.

Please refer to https://www.dbml.org/docs/ for the full list of syntaxes available.

Creating Tables & Fields

To create tables and fields, use the Table definition syntax (docs)

//Example
Table users {
  id int [PK]
  email varchar
  gender varchar
  relationship varchar
  dob datetime
  country int
}

Table countries {    
  code int [PK]
  name varchar
  continent_name varchar
}

Creating Relationships

We support 2 ways of creating relationships:

Change the header color for the table. Useful to highlight key tables, or differentiate between them quickly.