Chat2DB: Smart SQL client with ChatGPT

1 min


Chat2DB

Chat2DB

Smart SQL client with ChatGPT

Github logo

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.

Features

AI intelligent assistant

You can use natural language to write and execute SQL queries, or convert SQL queries to natural language for better understanding. You can also get suggestions for optimizing your SQL performance and readability.

Team collaboration

You can share your work with your teammates without exposing your online database password, ensuring the security of your enterprise database account.

Data management

You can manage various data objects, such as tables, views, stored procedures, functions, triggers, indexes, sequences, users, roles, and authorizations, with ease and efficiency.

Extension capability

You can connect to multiple databases, such as MySQL, PostgreSQL, Oracle, SQLServer, ClickHouse, OceanBase, H2, SQLite, and more. We are constantly adding support for more databases in the future.

Cross-platform development

You can use our product on Windows, Mac, Linux, or web browsers, thanks to our front-end development using Electron.

Environment isolation

You can separate your online and daily data permissions, ensuring the safety and integrity of your data.

Downloads

Windows

windows

MacOS ARM64

macos

MacOS X64

macos

JAR

java

Getting Started 🚀

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.

To access Chat2DB AI features faster, you can use WeChat to request your own API_KEY. The process is simple and easy.

🐳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: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.

Thank you for subscribing.

Something went wrong.


Like it? Share with your friends!

0
69 shares

0 Comments

Your email address will not be published. Required fields are marked *

Belmechri

I am an IT engineer, content creator, and proud father with a passion for innovation and excellence. In both my personal and professional life, I strive for excellence and am committed to finding innovative solutions to complex problems.
Choose A Format
Personality quiz
Series of questions that intends to reveal something about the personality
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Countdown
The Classic Internet Countdowns
Open List
Submit your own item and vote up for the best submission
Ranked List
Upvote or downvote to decide the best list item
Meme
Upload your own images to make custom memes
Video
Youtube and Vimeo Embeds
Audio
Soundcloud or Mixcloud Embeds
Image
Photo or GIF
Gif
GIF format