Chat2DB
Smart SQL client with ChatGPT
Chat2DB is an open-source tool for multiple databases from Alibaba. Unlike traditional database clients like Navicat and DBeaver, Chat2DB has AIGC capabilities that can turn natural language into SQL, and vice versa. It can also give SQL optimization tips to boost developers’ efficiency. It is a tool for database developers in the AI era, and even non-SQL users can use it to query data and generate reports quickly.
Windows
MacOS ARM64
MacOS X64
JAR
AI Configuration
CONFIGURE OPENAI
Option (1): To access the ChatSql feature of OPENAI, you need to satisfy two requirements:
- You need an OPENAI_API_KEY.
- To access the OPENAI website from the client’s network, you may need a VPN if you are in China. Make sure your VPN works well, or use the network proxy settings in the client to specify the HOST and PORT.
Option (2): Unified Proxy Service
- No OPENAI_API_KEY is required.
- You can access the service without using a proxy or VPN, provided that you have a network connection.
🐳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 [email protected]:alibaba/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
To debug the front end, you need to map the resources. You can use XSwitch and add this 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",
],
],
}
Join Guidady AI Mail List
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
0 Comments