GitHub - chenxian01/Chat2DB: ๐Ÿ”ฅ ๐Ÿ”ฅ ๐Ÿ”ฅ An intelligent and versatile general-purpose SQL client and reporting tool for databases which integrates ChatGPT capabilities.(ๆ™บ่ƒฝ็š„้€š็”จๆ•ฐๆฎๅบ“SQLๅฎขๆˆท็ซฏๅ’ŒๆŠฅ่กจๅทฅๅ…ท)

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ An intelligent and versatile general-purpose SQL client and reporting tool for databases which integrates ChatGPT capabilities.

Share Chat2DB Repository

Share on Telegram Share on Reddit

License Notation: Chat2DB is constructed and distributed for personal and non-commercial use only. For commercial use of this project, please contact corresponding authors.

Languages๏ผš English | ไธญๆ–‡

๐Ÿ“– Introduction

โ€ƒ โ€ƒChat2DB is a multi-database client tool that is open-source and free. It supports local installation on Windows and Mac, as well as server-side deployment and web page access. Compared to traditional database client software such as Navicat and DBeaver, Chat2DB integrates AIGC's capabilities and is able to convert natural language into SQL. It can also convert SQL into natural language and provide optimization suggestions for SQL to greatly enhance the efficiency of developers. It is a tool for database developers in the AI era, and even non-SQL business operators in the future can use it to quickly query business data and generate reports.

โœจ Features

  • ๐ŸŒˆ AI intelligent assistant, supporting natural language to SQL conversion, SQL to natural language conversion, and SQL optimization suggestions
  • ๐Ÿ‘ญ Support team collaboration, developers do not need to know the online database password, solving the problem of enterprise database account security
  • โš™๏ธ Powerful data management capability, supporting management of data tables, views, stored procedures, functions, triggers, indexes, sequences, users, roles, authorizations, etc.
  • ๐Ÿ”Œ Powerful extension capability, currently supporting MySQL, PostgreSQL, Oracle, SQLServer, ClickHouse, OceanBase, H2, SQLite, etc., and more databases will be supported in the future
  • ๐Ÿ›ก Front-end development using Electron, providing a solution that integrates Windows, Mac, Linux clients, and web versions
  • ๐ŸŽ Support environment isolation, online, and daily data permission separation

โฌ Download and Install

Description Download
Windows https://oss-chat2db.alibaba.com/release/1.0.11/Chat2DB%20Setup%201.0.11.exe
MacOS ARM64 https://oss-chat2db.alibaba.com/release/1.0.11/Chat2DB-1.0.11-arm64.dmg
MacOS X64 https://oss-chat2db.alibaba.com/release/1.0.11/Chat2DB-1.0.11.dmg
JarๅŒ… https://oss-chat2db.alibaba.com/release/1.0.11/ali-dbhub-server-start.jar

๐Ÿš€ Supported databases

Databases Status
Mysql โœ…
H2 โœ…
Oracle โœ…
PostgreSQL โœ…
SQLServer โœ…
SQLLite โœ…
MariaDB โœ…
ClickHouse โœ…
DM โœ…
Presto โœ…
DB2 โœ…
OceanBase โœ…
Redis โœ…
Hive โœ…
KingBase โœ…
MongoDB โœ…
Hbase Planning
Elasticsearch Planning
openGauss Planning
TiDB Planning
InfluxDB Planning

๐ŸŒฐ Demo

Create data source

Data source management

SQL console

AI intelligent assistant

๐Ÿ”ฅ AI Configuration

CONFIGURE OPENAI

Option 1 (recommended): To use the ChatSql function of OPENAI, two conditions must be met:

  • You need an OPENAI_API_KEY.
  • The client's network can connect to the OPENAI website, and for users in China, a VPN is required. Note: If the local VPN is not fully effective, the network connectivity can be ensured by setting the network proxy HOST and PORT in the client.

Option 2 (recommended): We provide a unified proxy service.

  • No OPENAI_API_KEY is required.
  • No proxy or VPN is required, as long as the network is connected.

To facilitate users' quick use of AI capabilities, you can scan the QR code below to follow our WeChat public account and apply for our custom API_KEY.

After the application is completed, refer to the following figure for configuration and usage. Config Api Host as http://test.sqlgpt.cn/gateway/api/.

CONFIGURE CUSTOM AI

๐Ÿ“ฆ Docker installation

docker pull chat2db/chat2db:latest

๐ŸŽฏ Operating Environment

Note: If local debugging is required

  • Java runtime Open JDK 17
  • JRE reference packaging and deployment method of jre.
  • Node runtime environment Node16 Node.js.

๐Ÿ’ป Local Debugging

  • git clone to local
$ git clone git@github.com:chat2db/Chat2DB.git
  • Front-End installation
$ cd Chat2DB/ali-dbhub-client
$ npm install # Mounting front-end dependency
$ npm run build:prod # Package js to the source directory on the back end
  • Backend debug
$ cd ../ali-dbhub-server
$ mvn clean install # maven 3.8 or later needs to be installed
$ cd ali-dbhub-server/ali-dbhub-server-start/target/
$ java -jar -Dchatgpt.apiKey=xxxxx ali-dbhub-server-start.jar  # To launch the chat application, you need to enter the ChatGPT key for the chatgpt.apiKey. Without entering it, you won't be able to use the AIGC function.
$ # open http://127.0.0.1:10821 to start debug Note: Front-end installation is required
  • Front-End debug
$ cd Chat2DB/ali-dbhub-client
$ npm install 
$ npm run start 
$ # open http://127.0.0.1:10821  to start Front-End debug
$ # Note Front-end page completely depends on the service, so front-end students need to debug the back-end project

But front debugging need mapping of resources, you can download XSwitch, add the following configuration file

{
  "proxy": [
    [
      "http://127.0.0.1:10821/(.*).js$",
      "http://127.0.0.1:8001/$1.js",
    ],
    [
      "http://127.0.0.1:10821/(.*).css$",
      "http://127.0.0.1:8001/$1.css",
    ],
    [
      "http://127.0.0.1:10821/static/front/(.*)",
      "http://127.0.0.1:8001/$1",
    ],
    [
      "http://127.0.0.1:10821/static/(.*)$",
      "http://127.0.0.1:8001/static/$1",
    ],
  ],
}

๐Ÿ“‘ Documentation

Stargazers

Stargazers repo roster for @chat2db/Chat2DB

Forkers

Forkers repo roster for @chat2db/Chat2DB

โ˜Ž๏ธ Contact Us

Please star and fork on GitHub before joining the group. Follow our WeChat public account

Ding Talk๏ผš9135032392

QQ:863576619

โค๏ธ Acknowledgements

Thanks to all the students who contributed to Chat2DB~