This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea4a61f
commit 195f0d4
Showing
1 changed file
with
8 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,239 +1,15 @@ | ||
### 🎁 Chat2DB将迁移到新地址:[Chat2DB++](https://github.com/chat2db/Chat2DB) 6月底将有重大升级,敬请期待 🔥🔥🔥 | ||
|
||
|
||
<h1 align="center">Chat2DB</h1> | ||
|
||
<div align="center"> | ||
|
||
智能且多功能的SQL客户端和报表工具,适用于各种数据库 | ||
|
||
[![License](https://img.shields.io/github/license/alibaba/fastjson2?color=4D7A97&logo=apache)](https://www.apache.org/licenses/LICENSE-2.0.html) | ||
[![Java support](https://img.shields.io/badge/Java-17+-green?logo=java&logoColor=white)](https://openjdk.java.net/) | ||
[![GitHub release](https://img.shields.io/github/release/alibaba/ali-dbhub)](https://github.com/alibaba/ali-dbhub/releases) | ||
[![GitHub Stars](https://img.shields.io/github/stars/alibaba/ali-dbhub)](https://github.com/alibaba/ali-dbhub/stargazers) | ||
[![GitHub Forks](https://img.shields.io/github/forks/alibaba/ali-dbhub)](https://github.com/alibaba/ali-dbhub/fork) | ||
[![GitHub Contributors](https://img.shields.io/github/contributors/alibaba/ali-dbhub)](https://github.com/alibaba/ali-dbhub/graphs/contributors) | ||
|
||
</div> | ||
|
||
<div align="center"> | ||
<p align="center"><b>分享 Chat2DB </b></p> | ||
<p align="center"> | ||
<a href="https://twitter.com/intent/tweet?text=Chat2DB-An%20intelligent%20and%20versatile%20general-purpose%20SQL%20client%20and%20reporting%20tool%20for%20databases%20which%20integrates%20ChatGPT%20capabilities.&url=https://github.com/alibaba/Chat2DB&hashtags=ChatGPT,AGI,SQL%20Client,Reporting%20tool" target="blank" > <img src="https://img.shields.io/twitter/follow/_Chat2DB?label=Share Repo on Twitter&style=social" alt=""/> </a> | ||
<a href="https://t.me/share/url?text=Chat2DB-An%20intelligent%20and%20versatile%20general-purpose%20SQL%20client%20and%20reporting%20tool%20for%20databases%20which%20integrates%20ChatGPT%20capabilities.&url=https://github.com/alibaba/Chat2DB" target="_blank"><img src="https://img.shields.io/twitter/url?label=Telegram&logo=Telegram&style=social&url=https://github.com/alibaba/Chat2DB" alt="Share on Telegram"/></a> | ||
<a href="https://api.whatsapp.com/send?text=Chat2DB-An%20intelligent%20and%20versatile%20general-purpose%20SQL%20client%20and%20reporting%20tool%20for%20databases%20which%20integrates%20ChatGPT%20capabilities.%20https://github.com/alibaba/Chat2DB"><img src="https://img.shields.io/twitter/url?label=whatsapp&logo=whatsapp&style=social&url=https://github.com/alibaba/Chat2DB" /></a> | ||
<a href="https://www.reddit.com/submit?url=https://github.com/alibaba/Chat2DB&title=Chat2DB-An%20intelligent%20and%20versatile%20general-purpose%20SQL%20client%20and%20reporting%20tool%20for%20databases%20which%20integrates%20ChatGPT%20capabilities." target="blank"><img src="https://img.shields.io/twitter/url?label=Reddit&logo=Reddit&style=social&url=https://github.com/alibaba/Chat2DB" alt="Share on Reddit"/></a> | ||
<a href="mailto:?subject=Check%20this%20GitHub%20repository%20out.&body=Chat2DB-An%20intelligent%20and%20versatile%20general-purpose%20SQL%20client%20and%20reporting%20tool%20for%20databases%20which%20integrates%20ChatGPT%20capabilities.%3A%0Ahttps://github.com/alibaba/Chat2DB" target="_blank"><img src="https://img.shields.io/twitter/url?label=Gmail&logo=Gmail&style=social&url=https://github.com/alibaba/Chat2DB"/></a> | ||
</p> | ||
|
||
**许可说明**: Chat2DB开源内容仅供个人免费使用,如想将该项目用于商业用途,请先联系该项目作者。 | ||
|
||
Languages: 中文 [English](README.md) | ||
</div> | ||
|
||
## 📖 简介 | ||
   Chat2DB 是一款有开源免费的多数据库客户端工具,支持windows、mac本地安装,也支持服务器端部署,web网页访问。和传统的数据库客户端软件Navicat、DBeaver 相比Chat2DB集成了AIGC的能力,能够将自然语言转换为SQL,也可以将SQL转换为自然语言,可以给出研发人员SQL的优化建议,极大的提升人员的效率,是AI时代数据库研发人员的利器,未来即使不懂SQL的运营业务也可以使用快速查询业务数据、生成报表能力。 | ||
## ✨ 特性 | ||
- 🌈 AI智能助手,支持自然语言转SQL、SQL转自然语言、SQL优化建议 | ||
- 👭 支持团队协作,研发无需知道线上数据库密码,解决企业数据库账号安全问题 | ||
- ⚙️ 强大的数据管理能力,支持数据表、视图、存储过程、函数、触发器、索引、序列、用户、角色、授权等管理 | ||
- 🔌 强大的扩展能力,目前已经支持MySQL、PostgreSQL、Oracle、SQLServer、ClickHouse、OceanBase、H2、SQLite等等,未来会支持更多的数据库 | ||
- 🛡 前端使用 Electron 开发,提供 Windows、Mac、Linux 客户端、网页版本一体化的解决方案 | ||
- 🎁 支持环境隔离、线上、日常数据权限分离 | ||
|
||
## ⏬ 下载安装 | ||
| 描述 | 下载地址 | | ||
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| Windows | [https://oss-chat2db.alibaba.com/release/1.0.11/Chat2DB%20Setup%201.0.11.exe](https://oss-chat2db.alibaba.com/release/1.0.10/Chat2DB%20Setup%201.0.10.exe) | | ||
| MacOS ARM64 (Apple芯片) | [https://oss-chat2db.alibaba.com/release/1.0.11/Chat2DB-1.0.11-arm64.dmg](https://oss-chat2db.alibaba.com/release/1.0.10/Chat2DB-1.0.10-arm64.dmg) | | ||
| MacOS X64 (Intel芯片) | [https://oss-chat2db.alibaba.com/release/1.0.11/Chat2DB-1.0.11.dmg](https://oss-chat2db.alibaba.com/release/1.0.10/Chat2DB-1.0.10.dmg) | | ||
| Jar包 | [https://oss-chat2db.alibaba.com/release/1.0.11/ali-dbhub-server-start.jar](https://oss-chat2db.alibaba.com/release/1.0.10/ali-dbhub-server-start.jar) | | ||
|
||
## 🚀 支持的数据库 | ||
| 数据库 | 支持计划 | | ||
|------------|---------| | ||
| 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 | ||
### 创建数据源 | ||
<a><img src="./document/image/img1.webp"/></a> | ||
|
||
### 数据源管理 | ||
<a><img src="./document/image/img2.webp"/></a> | ||
|
||
### SQL控制台 及 AI智能助手 | ||
#### 使用前需要配置OpenAI的Api Key及本地代理配置 | ||
<a><img src="./document/image/img4.webp"/></a> | ||
<a><img src="./document/image/img3.webp"/></a> | ||
|
||
|
||
## 🔥 AI配置 | ||
### 使用ChatGPT | ||
方式一(推荐):使用OPENAI的ChatSql功能需要满足两个条件 | ||
- 1、需要有一个openAI的key:OPENAI_API_KEY | ||
- 2、客户端网络可以连接到OPENAI官网,国内需要科学上网。注意:如果本地VPN未能全局生效,可以通过在客户端中设置网络代理HOST和PORT来保证网络连通性 | ||
- | ||
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01anrJMI1FEtSBbmTau_!!6000000000456-0-tps-1594-964.jpg" width="60%"/></a> | ||
|
||
方式二(推荐):使用我们提供了一个统一的代理服务。 | ||
- 1、不需要openAI的key | ||
- 2、不需要代理,不需要VPN只要可以联网即可使用。 | ||
|
||
为了方便大家更快速的使用AI的能力,可以关注微信公众号,回复"AI" 获得我们的自定义API_KEY,申请完成之后参考下图进行配置即可进行使用 | ||
|
||
<a><img src="https://oss-chat2db.alibaba.com/static/%E5%85%AC%E4%BC%97%E5%8F%B7.jpg" width="40%"/></a> | ||
|
||
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01xNobD21mo3B1ILrs2_!!6000000005000-0-tps-592-515.jpg" width="60%"/></a> | ||
|
||
|
||
## 📦 Docker部署 | ||
|
||
```bash | ||
docker pull chat2db/chat2db:latest | ||
// 前台运行,运行后不能关闭命令行 | ||
docker run -ti --name=chat2db -p 10824:10824 chat2db/chat2db:latest | ||
// 后台运行,运行后可以关闭命令行 | ||
docker run --name=chat2db -p 10824:10824 chat2db/chat2db:latest | ||
// 这里正常会提示 Tomcat started on port(s): 10824 (http) with context path 就可以结束了 | ||
# <h1 align="center">[Chat2DB++](https://github.com/chat2db/Chat2DB)🔥🔥🔥</h1> | ||
# <h1 align="center">重要公告: 此版本将不再维护Chat2DB将迁移到新地址[Chat2DB](https://github.com/chat2db/Chat2DB)</h1> | ||
# <h1 align="center"> The Chat2DB repository will be migrated to: [Chat2DB++](https://github.com/chat2db/Chat2DB).</h1> | ||
|
||
// 如果这里提示 The container name "/chat2db" is already in use by container, 代表已经存在容器了 运行 | ||
dcoker run chat2db | ||
// 如果想更新chat2db 则需要先rm 再运行 | ||
dcoker rm chat2db | ||
``` | ||
## 🎯 运行环境 | ||
注意: | ||
如果需要本地调试 | ||
- java运行 <a href="https://adoptopenjdk.net/" target="_blank">Open JDK 17</a> | ||
- Node运行环境Node16 <a href="https://nodejs.org/" target="_blank">Node.js</a>. | ||
## 💻 本地调试 | ||
- git clone到本地 | ||
```bash | ||
$ git clone git@github.com:alibaba/Chat2DB.git | ||
``` | ||
- 前端安装 | ||
```bash | ||
$ cd Chat2DB/ali-dbhub-client | ||
$ npm install # 安装前端依赖 | ||
$ npm run build:prod # 把js打包生成到后端的source目录 | ||
``` | ||
- 后端调试 | ||
```bash | ||
$ cd ../ali-dbhub-server | ||
$ mvn clean install # 需要安装maven 3.8以上版本 | ||
$ cd ali-dbhub-server/ali-dbhub-server-start/target/ | ||
$ java -jar -Dchatgpt.apiKey=xxxxx ali-dbhub-server-start.jar # 启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能 | ||
$ # 打开 http://127.0.0.1:10821 开启调试 注:需要进行前端安装 | ||
``` | ||
|
||
- 前端调试 | ||
```bash | ||
$ cd Chat2DB/ali-dbhub-client | ||
$ npm install | ||
$ npm run start | ||
$ # 打开 http://127.0.0.1:10821 开启前端调试 | ||
$ # 注:前端页面完全赖服务,所以前端同学调试也需要把后端项目跑起来 | ||
``` | ||
但是前端调试需要映射下资源,可以下载[XSwitch](https://chrome.google.com/webstore/detail/idkjhjggpffolpidfkikidcokdkdaogg),添加以下配置文件 | ||
``` json | ||
{ | ||
"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", | ||
], | ||
], | ||
} | ||
``` | ||
|
||
|
||
|
||
## 📑 文档 | ||
|
||
* <a href="https://chat2db.opensource.alibaba.com">官方文档</a> | ||
* <a href="https://github.com/alibaba/ali-dbhub/issues">Issue</a> | ||
|
||
## 常见问题 | ||
|
||
### 1、无法获取数据源驱动:getJDBCDriver error: null | ||
|
||
问题原因:无法联网导致下载数据库驱动包失败。 | ||
|
||
解决办法:手动下载相关驱动放入到 ~/.chat2db/jdbc-lib 目录下 | ||
|
||
下载链接 参考:<a href="https://github.com/alibaba/Chat2DB/blob/main/ali-dbhub-server/ali-dbhub-server-start/src/main/resources/application.yml">Application jdbc-jar-downLoad-urls</a> | ||
- https://oss-chat2db.alibaba.com/lib/mysql-connector-java-8.0.30.jar | ||
- https://oss-chat2db.alibaba.com/lib/mysql-connector-java-5.1.47.jar | ||
- https://oss-chat2db.alibaba.com/lib/clickhouse-jdbc-0.3.2-patch8-http.jar | ||
- https://oss-chat2db.alibaba.com/lib/mariadb-java-client-3.0.8.jar | ||
- https://oss-chat2db.alibaba.com/lib/mssql-jdbc-11.2.1.jre17.jar | ||
- https://oss-chat2db.alibaba.com/lib/oceanbase-client-2.4.2.jar | ||
- https://oss-chat2db.alibaba.com/lib/postgresql-42.5.1.jar | ||
- https://oss-chat2db.alibaba.com/lib/sqlite-jdbc-3.39.3.0.jar | ||
- https://oss-chat2db.alibaba.com/lib/ojdbc11.jar | ||
|
||
|
||
|
||
|
||
## Stargazers | ||
[![Stargazers repo roster for @alibaba/Chat2DB](https://reporoster.com/stars/alibaba/Chat2DB)](https://github.com/alibaba/Chat2DB/stargazers) | ||
|
||
## Forkers | ||
[![Forkers repo roster for @alibaba/Chat2DB](https://reporoster.com/forks/alibaba/Chat2DB)](https://github.com/alibaba/Chat2DB/network/members) | ||
|
||
## ☎️ 联系我们 | ||
|
||
加群前请先Star和Fork,谢谢~关注微信公众号,回复"AI",关注Chat2DB最新动态和更新。 | ||
|
||
<a><img src="https://oss-chat2db.alibaba.com/static/%E5%85%AC%E4%BC%97%E5%8F%B7.jpg" width="30%"/></a> | ||
|
||
## <h1 align="center">新版本已经发布 快去体验吧:https://github.com/chat2db/Chat2DB </h1> | ||
## <h1 align="center"> 新版本特性 </h1> | ||
|
||
<h1 align="center"> - UI全面升级,体验更好 </h1> | ||
<h1 align="center"> - 支持BI报表功能,自然语言生成报表 </h1> | ||
<h1 align="center"> - 可以无限体验AI </h1> | ||
|
||
## ❤️ 致谢 | ||
感谢所有为Chat2DB贡献力量的同学们~ | ||
|
||
<a href="https://github.com/alibaba/ali-dbhub/graphs/contributors"> | ||
<img src="https://contrib.rocks/image?repo=alibaba/Chat2DB" /> | ||
</a> | ||
|
||
## Star History | ||
|
||
<a href="https://star-history.com/#alibaba/chat2db&Date"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=alibaba/chat2db&type=Date&theme=dark" /> | ||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=alibaba/chat2db&type=Date" /> | ||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=alibaba/chat2db&type=Date" /> | ||
</picture> | ||
</a> | ||
|