Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

Chat2DB

> 数据库
Open source

🔥🔥🔥 AI-driven database tool and SQL client, The hottest GUI client, supporting MySQL, Oracle, PostgreSQL, DB2, SQL Server, DB2, SQLite, H2, ClickHouse, and m

27.6K stars0 likes4 views
WebsiteGitHub

About

🔥🔥🔥 AI-driven database tool and SQL client, The hottest GUI client, supporting MySQL, Oracle, PostgreSQL, DB2, SQL Server, DB2, SQLite, H2, ClickHouse, and m


An AI-powered database client and SQL workspace for developers, DBAs, analysts, and data teams.

What is Chat2DB?

Chat2DB Community is a free, cross-platform database client for Windows, macOS, and Linux. It runs entirely on your machine and combines a full-featured SQL workspace with an AI assistant that you connect to your own model.

  • 40+ databases — MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, MongoDB, Redis, SQLite, MariaDB, TiDB, Hive, DB2, Snowflake, BigQuery, Elasticsearch, Trino, TimescaleDB, Greenplum, YugabyteDB, CrateDB, QuestDB, Apache IoTDB, Firebird, HSQLDB, Apache Derby, and more via plugins — new JDBC databases can be added through configuration only, without code changes.
  • SQL workspace — editing, completion, formatting, execution, saved SQL, and execution history.
  • AI assistant — bring your own AI model to generate, explain, and optimize SQL in natural language.
  • Database management — browse metadata, manage tables and objects (DDL/DML), and edit data in place.
  • Data import and export, dashboards and charts, and an open-source CLI with MCP support.

Screenshots

Dashboards and charts ER diagrams
Visual data management Data import and export

Quick Start

Option 1: Desktop App

Download the installer for your platform from GitHub Releases, install it, and start connecting to your databases. No further setup is required.

Option 2: Docker

Requirements: Docker 19.03.0+, Docker Compose 2.0.0+ (Compose V2, only for the Compose variant), 2+ CPU cores, 4+ GiB RAM.

First create the encryption key (see Encryption Key for why it matters), then start the container:

…

Then open http://localhost:10825 in your browser.

Alternatively, use the bundled Compose definition:

bash
./script/security/init-community-encryption-key.sh
docker compose --file docker/docker-compose.yml up --detach

Notes:

  • To update, pull the new image, remove the old container, and run the start command again. Keep ~/.config/chat2db-community/encryption.key across rebuilds.
  • The docker run example stores application data in $HOME/.chat2db-community-docker; the Compose definition uses the chat2db-community-data named volume. These locations do not share data.
  • Chat2DB Community 5.3.0 uses the independent /root/.chat2db-community directory and does not automatically migrate data from earlier images that used /root/.chat2db.

Security Notes

Chat2DB Community is a single-user, local-first application. It has no user accounts or authorization boundaries between users. Keep the HTTP service bound to 127.0.0.1 or ::1 and do not expose it to other users or untrusted networks.

Custom JDBC drivers are executable Java code — install them only from sources you trust. Imported configuration files, archives, SQL files, database contents, and AI responses remain untrusted data. See the Security Policy for the complete trust boundary and vulnerability reporting process.

If you find this project useful, please give us a Star ⭐️ — it really helps!

Encryption Key

Chat2DB Community encrypts stored datasource passwords and AI model API keys with AES-256-GCM using a per-installation key. Create it once from a repository checkout (requires openssl):

bash
./script/security/init-community-encryption-key.sh

The key is written to ~/.config/chat2db-community/encryption.key. Back this file up separately and keep it across upgrades and container rebuilds — replacing or losing it makes previously stored datasource passwords and AI model API keys unreadable. Web/headless startup fails when no valid key is provided; only Desktop mode creates a missing key automatically.

Key configuration reference (custom paths, resolution order, validation)

The key must be valid Base64 that decodes to exactly 32 bytes. The bundled initializer generates the standard padded form: 44 Base64 characters ending in =. It is cryptographic key material, not a human-readable password. Datasource passwords and AI API keys use the same key with separate authenticated AAD values, so ciphertext from one purpose cannot be decrypted as the other.

To use a custom path, pass it to the script and configure the same path when starting Chat2DB:

bash
./script/security/init-community-encryption-key.sh /secure/path/chat2db-community.key

java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.gui=false \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file=/secure/path/chat2db-community.key \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

The script's key-file path priority is the positional argument, CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE, then the default path. It reuses a valid regular file, rejects symbolic links and non-regular files, and refuses to overwrite an invalid file. Keep the key readable only by the Chat2DB process owner.

Key configuration is resolved in this order:

  1. JVM property chat2db.community.encryption-key containing the Base64 key.
  2. Environment variable CHAT2DB_COMMUNITY_ENCRYPTION_KEY containing the Base64 key.
  3. JVM property chat2db.community.encryption-key-file containing a key-file path.
  4. Environment variable CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE containing a key-file path.
  5. Default file ~/.config/chat2db-community/encryption.key.

The first configured value is authoritative. A blank value, malformed Base64, a key that does not decode to 32 bytes, or an invalid key file fails startup instead of falling through to the next source. File-based configuration is recommended because it avoids placing the key value directly in process arguments or environment variables.

Automatic key-file creation depends on chat2db.mode, not chat2db.gui. Community Desktop mode (chat2db.runtime.mode=community with chat2db.mode=DESKTOP) creates the selected key file when no inline key is configured and the file is missing. Any non-Desktop mode, including normal Web/headless startup, never creates a missing key and fails until a valid key is provided or initialized. The resolved key is cached for the process lifetime, so changing key configuration requires an application restart.

Build from Source

Prerequisites

  • Java runtime: Eclipse Temurin 17
  • Node.js 18.17.0 or later
  • Maven 3.8 or later

Clone the Repository

bash
git clone https://github.com/OtterMind/Chat2DB.git

Frontend

Use Yarn with the checked-in lockfile.

bash
cd Chat2DB/chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot

Backend

…

Build a Local Docker Image

bash
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0

Database guides

Step-by-step guides for connecting Chat2DB Community to specific databases:

  • BigQuery — Google BigQuery via a Google Cloud service account.

Community vs Commercial Editions

The Community edition contains the full local database client described above, including custom AI model support. The commercial Pro and Enterprise editions build on the same core and add hosted AI services, user accounts, cloud storage and multi-device sync, and team collaboration and governance features. See chat2db.ai for details.

Contributing

We welcome bug reports, feature requests, documentation improvements, testing feedback, and pull requests from the community.

Before opening an issue or submitting a pull request, please read our Contributing Guide. It explains how to report bugs, suggest improvements, and make contributions easier for maintainers to review.

  • For bugs and feature requests, please use GitHub Issues.
  • For questions, setup help, and open-ended discussions, please use GitHub Discussions.
  • If your pull request is related to an issue, please link it in the PR description.

Community and Support

  • GitHub Issues: report a bug or request a feature
  • GitHub Discussions: ask questions and share ideas
  • Discord: join our Discord server
  • Email: [email protected]

Acknowledgments

Thanks to everyone who has contributed to Chat2DB.

License

Chat2DB Community version 5.3.0 and later is available under the license terms in this repository. This is a source-available license based on the Apache License 2.0 with additional conditions. Chat2DB releases published before version 5.3.0, including version 0.3.7 and the earlier historical tags, remain under the Apache License 2.0.

Issues· 235 open

View all issuesOpen on GitHub
  • #2924

    chat2db local 离线版5.3.6之后,查询结果大文本自动截断,导致通过客户端复制insert into语句内容不完整

    Updated Sep 30, 2026
  • #2944

    Parameterised Queries: Interactive SQL Query Parameters in SQL Console

    Updated Sep 24, 2026
  • #2952

    保存数据源报错:fastjson2.JSONException

    Updated Sep 23, 2026
  • #2928

    chat2Db mac 社区版本5.30版本,sqlserver 2012连接不上

    Updated Sep 18, 2026
  • #2509

    bug(export): BaseExporter.multi leaks InputStream[] on error path

    Updated Sep 17, 2026
  • #2545

    bug(export): DbDmlExport CSV/Excel does not enforce SELECT-only

    needs/infoUpdated Sep 12, 2026
  • #2892

    终端有问题

    Updated Sep 11, 2026
  • #2748

    feature(data editor): search and quickly locate table fields

    Updated Sep 9, 2026
  • #2894

    Unify export workflow with a configurable wizard and explicit failure handling

    area/import-exportedition/communityneeds/decisionUpdated Sep 9, 2026
  • #2477

    bug(presto): tableDDL throws UnsupportedOperationException (wrong override signature)

    Updated Sep 9, 2026

> Tags

Javaaibichatgptclickhouse

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库