Databases 6 min read

Quickly Design Databases with the Open‑Source DrawDB Tool

This guide introduces the open‑source DrawDB tool, walks through Docker‑based installation, demonstrates designing tables and relationships using a mall e‑commerce permission module example, and covers SQL import/export, theme switching, and template customization, helping developers efficiently create database schemas.

Su San Talks Tech
Su San Talks Tech
Su San Talks Tech
Quickly Design Databases with the Open‑Source DrawDB Tool

In the early stage of a project, a good database design tool can greatly improve efficiency. This article introduces DrawDB, an open‑source, visually appealing database design tool with modeling and SQL generation features.

DrawDB Overview

DrawDB is an open‑source database design tool that has gained over 20K+ stars on GitHub. It offers intuitive design, modeling, and an SQL generator to export designs as scripts.

Below is a screenshot of DrawDB in action.

DrawDB interface
DrawDB interface

Installing DrawDB

Using Docker is the most convenient way to install DrawDB.

First, pull the Docker image: docker pull xinsodev/drawdb Then run the container, exposing port 3000:

$ docker run --name some-drawdb -p 3000:80 -d xinsodev/drawdb

Access the editor at http://192.168.3.101:3000 and click Editor to open the design page.

DrawDB editor page
DrawDB editor page

Using DrawDB

The article demonstrates DrawDB with the permission module of a mall e‑commerce project.

Designing Tables

Use the Add Table button to create tables and Add Column to add fields.

Drag the small dots on fields to create relationships.

Set mapping relationships via the relationship panel.

Table design in DrawDB
Table design in DrawDB
Creating relationships
Creating relationships
Mapping relationships
Mapping relationships

Import/Export SQL

Export the database design to SQL files (supports MySQL, PostgreSQL, SQLite, etc.).

Import SQL files to generate a database design.

Export SQL
Export SQL
Import SQL
Import SQL

Theme Configuration

DrawDB supports dark and light themes. Use the Theme function to switch between them.

Theme switch
Theme switch

Template Configuration

Choose different color templates via the Templates function on the homepage.

Template selection
Template selection
Colorful template preview
Colorful template preview

Conclusion

Using the mall e‑commerce permission module as an example, the article walks through DrawDB’s main features. DrawDB is easy to install and use, making it a handy tool for anyone needing to design database tables.

Project Address

https://github.com/drawdb-io/drawdb

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Dockeropen sourceDatabase designSQL generationDrawDB
Su San Talks Tech
Written by

Su San Talks Tech

Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.