← 返回到所有服务
GitHub 仓库信息
获取时间 · 2026年6月5日 ★ 22,324 最新版本: v1.20.1 最后更新: 2026年6月5日
README
<h1 align="center">
<a href="https://chartdb.io#gh-light-mode-only">
<img src="https://github.com/chartdb/chartdb/blob/main/src/assets/logo-light.png" width="400" height="70" alt="ChartDB">
</a>
<a href="https://chartdb.io##gh-dark-mode-only">
<img src="https://github.com/chartdb/chartdb/blob/main/src/assets/logo-dark.png" width="400" height="70" alt="ChartDB">
</a>
<br>
</h1>
<p align="center">
<b>Open-source database diagrams editor</b> <br />
<b>No installations • No Database password required.</b> <br />
</p>
<h3 align="center">
<a href="https://discord.gg/QeFwyWSKwC">Community</a> •
<a href="https://www.chartdb.io?ref=github_readme">Website</a> •
<a href="https://chartdb.io/templates?ref=github_readme">Examples</a> •
<a href="https://app.chartdb.io?ref=github_readme">Demo</a>
</h3>
<h4 align="center">
<a href="https://github.com/chartdb/chartdb?tab=AGPL-3.0-1-ov-file#readme">
<img src="https://img.shields.io/github/license/chartdb/chartdb?color=blue" alt="ChartDB is released under the AGPL license." />
</a>
<a href="https://github.com/chartdb/chartdb/blob/main/CONTRIBUTING.md">
<img src="https://img.shields.io/badge/PRs-Welcome-brightgreen" alt="PRs welcome!" />
</a>
<a href="https://discord.gg/QeFwyWSKwC">
<img src="https://img.shields.io/discord/1277047413705670678?color=5865F2&label=Discord&logo=discord&logoColor=white" alt="Discord community channel" />
</a>
<a href="https://x.com/intent/follow?screen_name=jonathanfishner">
<img src="https://img.shields.io/twitter/follow/jonathanfishner?style=social"/>
</a>
</h4>
---
<p align="center">
<img width='700px' src="./public/chartdb.png">
</p>
### 🎉 ChartDB
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.
### Status
ChartDB is currently in Public Beta. Star and watch this repository to get notified of updates.
### Supported Databases
- ✅ PostgreSQL (<img src="./src/assets/postgresql_logo_2.png" width="15"/> + <img src="./src/assets/supabase.png" alt="Supabase" width="15"/> + <img src="./src/assets/timescale.png" alt="Timescale" width="15"/> )
- ✅ MySQL
- ✅ SQL Server
- ✅ MariaDB
- ✅ SQLite (<img src="./src/assets/sqlite_logo_2.png" width="15"/> + <img src="./src/assets/cloudflare_d1.png" alt="Cloudflare D1" width="15"/> Cloudflare D1)
- ✅ CockroachDB
- ✅ ClickHouse
## Getting Started
Use the [cloud version](https://app.chartdb.io?ref=github_readme_2) or deploy locally:
### How To Use
```bash
npm install
npm run dev
```
### Build
```bash
npm install
npm run build
```
Or like this if you want to have AI capabilities:
```bash
npm install
VITE_OPENAI_API_KEY=<YOUR_OPEN_AI_KEY> npm run build
```
### Run the Docker Container
```bash
docker run -e OPENAI_API_KEY=<YOUR_OPEN_AI_KEY> -p 8080:80 ghcr.io/chartdb/chartdb:latest
```
#### Build and Run locally
```bash
docker build -t chartdb .
docker run -e OPENAI_API_KEY=<YOUR_OPEN_AI_KEY> -p 8080:80 chartdb
```
#### Using Custom Inference Server
```bash
# 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 chartdb
```
> **Privacy Note:** ChartDB includes privacy-focused analytics via Fathom Analytics. You can disable this by adding `-e DISABLE_ANALYTICS=true` to the run command or `--build-arg VITE_DISABLE_ANALYTICS=true` when 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:
```bash
VITE_OPENAI_API_ENDPOINT=http://localhost:8000/v1
VITE_LLM_MODEL_NAME=Qwen/Qwen2.5-32B-Instruct-AWQ
```
## Try it on our website
1. Go to [ChartDB.io](https://chartdb.io?ref=github_readme_2)
2. Click "Go to app"
3. Choose the database that you are using.
4. Take the magic query and run it in your database.
5. Copy and paste the resulting JSON set into ChartDB.
6. Enjoy Viewing & Editing!
## 💚 Community & Support
- [Discord](https://discord.gg/QeFwyWSKwC) (For live discussion with the community and the ChartDB team)
- [GitHub Issues](https://github.com/chartdb/chartdb/issues) (For any bugs and errors you encounter using ChartDB)
- [Twitter](https://x.com/intent/follow?screen_name=jonathanfishner) (Get news fast)
## Contributing
We welcome community contributions, big or small, and are here to guide you along
the way. Message us in the [ChartDB Community Discord](https://discord.gg/QeFwyWSKwC).
For more information on how to contribute, please see our
[Contributing Guide](/CONTRIBUTING.md).
This project is released with a [Contributor Code of Conduct](/CODE_OF_CONDUCT.md).
By participating in this project, you agree to follow its terms.
Thank you for helping us make ChartDB better for everyone :heart:.
## License
ChartDB is licensed under the [GNU Affero General Public License v3.0](LICENSE)
ChartDB 是一个强大的、基于 Web 的数据库图表编辑器。通过单个"智能查询"即可立即可视化数据库结构。无需账户即可使用所有功能,包括自定义图表和导出 SQL 脚本。
主要功能
- 即时模式导入:运行单个查询即可立即以 JSON 格式获取数据库结构
- AI 驱动的导出:使用 AI 生成目标数据库方言的 DDL 脚本
- 交互式编辑:使用直观的编辑器微调数据库结构
- 多数据库支持:支持 PostgreSQL、MySQL、SQL Server、MariaDB、SQLite、CockroachDB 和 ClickHouse
技术特点
- React:现代化的前端框架
- TypeScript:类型安全的代码
- React Flow:用于图表可视化
- Docker:容器化部署支持
- OpenAI 集成:用于 AI 功能(可选)
部署要求
- Node.js 环境
- 现代浏览器
- 网络连接
- 可选:OpenAI API 密钥(用于 AI 功能)
特色功能
- 无需安装:直接在浏览器中运行
- 无需数据库密码:通过查询结果即可工作
- 多数据库支持:支持主流数据库系统
- AI 辅助迁移:支持跨数据库迁移
- 交互式编辑:直观的数据库结构编辑界面