mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-08-06 00:50:29 +08:00
114 lines
3.9 KiB
Markdown
114 lines
3.9 KiB
Markdown

|
|
|
|
<div align="center">
|
|
<h3>SQL Chat</h3>
|
|
<a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsqlchat%2Fsqlchat&env=OPENAI_API_KEY"><img src="https://img.shields.io/badge/deploy%20on-Vercel-brightgreen.svg?style=for-the-badge&logo=vercel" alt="vercel"></a>
|
|
</div>
|
|
|
|
## What
|
|
|
|
SQL Chat is a chat-based SQL client to ask database questions and query databases using natural language.
|
|
|
|

|
|
|
|

|
|
|
|
## Why
|
|
|
|
As we enter the [Developer Tools 2.0 era](https://www.sequoiacap.com/article/ai-powered-developer-tools/),
|
|
there is a massive opportunity to rebuild the existing tools using the chat-based interface. SQL Client
|
|
is no exception. Instead of navigating across many UI controls, a chat-based interface is much
|
|
more intuitive. Of course, only if that works, and our goal is to deliver that experience.
|
|
|
|
## How
|
|
|
|
SQL Chat is built by Next.js, it supports the following databases and will add more over time:
|
|
|
|
- MySQL
|
|
- PostgreSQL
|
|
- MSSQL
|
|
|
|
## Data Privacy
|
|
|
|
- All database connection configs are stored locally in your browser. You can also visit settings to
|
|
clear the data.
|
|
|
|
- Only the database schema will be sent to the OpenAI API. No table data will be sent there.
|
|
|
|
## Deploy with Docker
|
|
|
|
```bash
|
|
docker run -d --name sqlchat -p 3000:3000 sqlchat/sqlchat:latest
|
|
```
|
|
|
|
You can set the following environment variables to customize the deployment:
|
|
|
|
- `OPENAI_API_KEY`: OpenAI API key. You can get one from [here](https://beta.openai.com/docs/developer-quickstart/api-keys).
|
|
- `OPENAI_API_ENDPOINT`: OpenAI API endpoint. Defaults to `https://api.openai.com`.
|
|
|
|
## Local Development
|
|
|
|
1. Make a copy of the example environment variables file;
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
2. Add your [API key](https://platform.openai.com/account/api-keys) and OpenAI API Endpoint(optional) to the newly created `.env` file;
|
|
|
|
3. Install dependencies and start the dev server;
|
|
|
|
```bash
|
|
pnpm i && pnpm dev
|
|
```
|
|
|
|
## Common questions
|
|
|
|
<details><summary>How to self host SQL Chat?</summary>
|
|
<p>
|
|
|
|
- You can deploy SQL Chat to Vercel with one click
|
|
|
|
<a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsqlchat%2Fsqlchat&env=OPENAI_API_KEY"><img src="https://img.shields.io/badge/deploy%20on-Vercel-brightgreen.svg?style=for-the-badge&logo=vercel" alt="vercel"></a>
|
|
|
|
- You can deploy your SQL Chat with docker in seconds
|
|
|
|
```bash
|
|
docker run -d --name sqlchat -p 3000:3000 sqlchat/sqlchat:latest
|
|
```
|
|
|
|
</p>
|
|
</details>
|
|
|
|
<details><summary>It always says that I have a network connection issue?</summary>
|
|
<p>
|
|
|
|
Please make sure you have a stable network connection which can access the OpenAI API endpoint. If you cannot access the OpenAI API endpoint, you can try to set the `OPENAI_API_ENDPOINT` in UI or environment variable.
|
|
|
|
</p>
|
|
</details>
|
|
|
|
## Star History
|
|
|
|
[](https://star-history.com/#sqlchat/sqlchat&Date)
|
|
|
|
## Community
|
|
|
|
[](https://discord.gg/z6kakemDjm)
|
|
|
|
[](https://twitter.com/Bytebase)
|
|
|
|
<img width="256" src="https://raw.githubusercontent.com/sqlchat/sqlchat/main/public/wechat-qrcode.webp" alt="sqlchat">
|
|
|
|
## Sponsors
|
|
|
|
<p>
|
|
<a href="https://www.bytebase.com">
|
|
<img src="https://raw.githubusercontent.com/sqlchat/sqlchat/main/public/bytebase.webp" width=300>
|
|
</a>
|
|
</p>
|
|
|
|
## License
|
|
|
|
This project is under the BSL License. See the [LICENSE](LICENSE) file for the full license text.
|