Getting Started with Diagrams
ChartDB provides multiple ways to create database diagrams. Whether you’re starting from scratch, using a template, or importing an existing schema, ChartDB makes it easy to visualize your database structure.Creating a New Diagram
Starting from Scratch
To create a blank diagram:Select Database Type
Choose your database type (MySQL, PostgreSQL, SQLite, SQL Server, MariaDB, etc.) when creating a new diagram.
Create Your First Table
Right-click on the canvas and select New Table from the context menu, or use the keyboard shortcut:
- macOS:
⌘ + Click - Windows/Linux:
Ctrl + Click
ChartDB automatically saves your diagram as you work, so you don’t have to worry about losing your progress.
Using Templates
ChartDB provides over 40 pre-built database templates to help you get started quickly. These templates are based on real-world applications and popular frameworks.Available Template Categories
Framework Templates
- Laravel (Authentication, Permissions, Spark)
- Django (Core, Axes)
- Adonis ACL
- Rails (Devise, Doorkeeper, Flipper)
Application Templates
- WordPress
- Flarum
- BookStack
- Monica (Personal CRM)
- Koel (Music Streaming)
Domain Templates
- Employee Management
- E-commerce (Sylius)
- Ticketing (Ticketit)
- Accounting (Akaunting)
Example Apps
- Twitter Clone
- Airbnb Clone
- Hacker News
- Pokemon Database
Using a Template
Browse Templates
From the home screen or new diagram dialog, browse through the available templates.
Select Template
Click on a template to preview its structure. Each template shows:
- Number of tables
- Database type
- Relationships
- Description and source URL (if available)
Importing Existing Schemas
You can import your existing database schema into ChartDB using several methods:Import from SQL DDL
Import your database schema from SQL Data Definition Language statements:Access Import
Right-click on the canvas and select Import SQL/DBML, or use the import button in the toolbar.
Import from DBML
DBML (Database Markup Language) is a simple, readable DSL for defining database schemas:Import from Database Connection
Connect directly to your database to import the live schema:Database connection import supports PostgreSQL, MySQL, MariaDB, and SQL Server.
Diagram Configuration
Database Type Settings
Each diagram is tied to a specific database type, which affects:- Available data types
- SQL syntax for exports
- Field attributes and constraints
- Default schema naming
- PostgreSQL
- MySQL
- MariaDB
- SQL Server
- SQLite
- Generic SQL
Database Edition
Some database types support multiple editions with different capabilities:PostgreSQL Editions
PostgreSQL Editions
- Standard PostgreSQL
- PostgreSQL with specific extensions
SQL Server Editions
SQL Server Editions
- SQL Server Express
- SQL Server Standard
- SQL Server Enterprise
Diagram Views
ChartDB supports both tables and database views:Creating Views
Database views can be created alongside regular tables:Views are marked with the
isView property and can optionally be marked as isMaterializedView for databases that support materialized views.Canvas Controls
Navigation
- Pan: Click and drag on empty canvas space
- Zoom: Use mouse wheel or pinch gesture
- Fit to Screen: Press
⌘0(Mac) orCtrl+0(Windows) to view all elements
Canvas Context Menu
Right-click on the canvas to access:- Create new table
- Create new view (if enabled)
- Create new relationship
- Create new area (for grouping)
- Create new note
- Import SQL/DBML
Schema Organization
For databases that support schemas (like PostgreSQL), you can organize tables into different schemas:Best Practices
Start with Templates
Start with Templates
If you’re building a common type of application (e-commerce, blog, SaaS), start with a template and modify it. This saves time and ensures you don’t miss important tables.
Use Meaningful Names
Use Meaningful Names
Give your diagram a clear, descriptive name that indicates its purpose or the application it represents.
Import Real Schemas
Import Real Schemas
If you have an existing database, import it rather than recreating it manually. This ensures accuracy and saves time.
Choose the Right Database Type
Choose the Right Database Type
Select the correct database type at the start. While you can change it later, data types and features vary between databases.
Next Steps
Editing Schema
Learn how to add and modify tables and fields
Managing Relationships
Create and manage relationships between tables
Using Areas
Organize your diagram with areas
Templates
Explore all available templates
