Open-source database diagrams editor
No installations • No Database password required.
ChartDB is a powerful, web-based database diagramming editor. Instantly visualize your database schema with a single "Smart Query." Customize diagrams, export SQL scripts, and access all features—no account required. Experience seamless database design here.
What it does:
-
Instant Schema Import Run a single query to instantly retrieve your database schema as JSON. This makes it incredibly fast to visualize your database schema, whether for documentation, team discussions, or simply understanding your data better.
-
AI-Powered Export for Easy Migration Our AI-driven export feature allows you to generate the DDL script in the dialect of your choice. Whether you're migrating from MySQL to PostgreSQL or from SQLite to MariaDB, ChartDB simplifies the process by providing the necessary scripts tailored to your target database.
-
Interactive Editing Fine-tune your database schema using our intuitive editor. Easily make adjustments or annotations to better visualize complex structures.
ChartDB is currently in Public Beta. Star and watch this repository to get notified of updates.
- ✅ PostgreSQL (
+
+
) - ✅ MySQL
- ✅ SQL Server
- ✅ MariaDB
- ✅ SQLite (
+
Cloudflare D1) - ✅ CockroachDB
- ✅ ClickHouse
Use the cloud version or deploy locally:
npm install
npm run devnpm install
npm run buildOr like this if you want to have AI capabilities:
npm install
VITE_OPENAI_API_KEY=<YOUR_OPEN_AI_KEY> npm run builddocker run -e OPENAI_API_KEY=<YOUR_OPEN_AI_KEY> -p 8080:80 ghcr.io/chartdb/chartdb:latestdocker build -t chartdb .
docker run -e OPENAI_API_KEY=<YOUR_OPEN_AI_KEY> -p 8080:80 chartdb# Build
docker build \
--build-arg VITE_OPENAI_API_ENDPOINT=<YOUR_ENDPOINT> \
--build-arg VITE_LLM_MODEL_NAME=<YOUR_MODEL_NAME> \
-t chartdb .
# Run
docker run \
-e OPENAI_API_ENDPOINT=<YOUR_ENDPOINT> \
-e LLM_MODEL_NAME=<YOUR_MODEL_NAME> \
-p 8080:80 chartdbA self-hosted instance can publish diagrams so that every browser opens the same,
up-to-date diagram under the same URL. This is off unless SHARED_DIAGRAMS_URL is set,
and it never changes the behaviour of diagrams you create yourself.
# 1. Generate a diagram from a schema dump (no database connection needed)
npm run build:shared-diagram -- \
--sql ./mysql-schema.sql --id my-app --name "my-app" --out ./shared
# 2. Serve ./shared next to the app and point the container at the index
docker run \
-e SHARED_DIAGRAMS_URL=/shared/index.json \
-v $PWD/shared:/usr/share/nginx/html/shared:ro \
-p 8080:80 chartdbOn load the app reads the index, and for every entry whose updatedAt is newer than the
local copy it re-imports the diagram under the id given in the index. Table positions,
widths, colours and collapsed state are carried over from the local copy, so a hand-arranged
layout survives the update. Re-running step 1 after each schema dump is enough to keep
every browser current.
aliases lets an old URL keep working: a request for an alias id redirects to the
canonical diagram.
[
{
"id": "my-app",
"url": "/shared/my-app.json",
"updatedAt": "2026-08-05T00:00:00.000Z",
"aliases": ["ab12cd34ef56"]
}
]Privacy Note: ChartDB includes privacy-focused analytics via Fathom Analytics. You can disable this by adding
-e DISABLE_ANALYTICS=trueto the run command or--build-arg VITE_DISABLE_ANALYTICS=truewhen building.
Note: You must configure either Option 1 (OpenAI API key) OR Option 2 (Custom endpoint and model name) for AI capabilities to work. Do not mix the two options.
Open your browser and navigate to http://localhost:8080.
Example configuration for a local vLLM server:
VITE_OPENAI_API_ENDPOINT=http://localhost:8000/v1
VITE_LLM_MODEL_NAME=Qwen/Qwen2.5-32B-Instruct-AWQ- Go to ChartDB.io
- Click "Go to app"
- Choose the database that you are using.
- Take the magic query and run it in your database.
- Copy and paste the resulting JSON set into ChartDB.
- Enjoy Viewing & Editing!
- Discord (For live discussion with the community and the ChartDB team)
- GitHub Issues (For any bugs and errors you encounter using ChartDB)
- Twitter (Get news fast)
We welcome community contributions, big or small, and are here to guide you along the way. Message us in the ChartDB Community Discord.
For more information on how to contribute, please see our Contributing Guide.
This project is released with a Contributor Code of Conduct. By participating in this project, you agree to follow its terms.
Thank you for helping us make ChartDB better for everyone ❤️.
ChartDB is licensed under the GNU Affero General Public License v3.0
