GithubHelp home page GithubHelp logo

lynnwang99 / sqlchat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sqlchat/sqlchat

0.0 0.0 0.0 1.34 MB

Chat-based SQL Client and Editor for the next decade

Home Page: https://sqlchat.ai

License: Other

JavaScript 0.34% TypeScript 98.11% CSS 0.79% Dockerfile 0.76%

sqlchat's Introduction

SQL Chat banner

SQL Chat

vercel

What

SQL Chat is a chat-based SQL client to ask database questions and query databases using natural language.

Screenshot

Screenshot

Why

As we enter the Developer Tools 2.0 era, 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.

  • If you use sqlchat.ai, it will record the anonymised conversations.

IP Whitelisting

If you use sqlchat.ai to connect to your database, you need to add 0.0.0.0 (allow all connections) to the database whitelist IP. Because sqlchat.ai is hosted on Vercel which uses dynamic IP. If this is a concern, please consider the self-host option below.

Self-host with Docker

docker run --name sqlchat --platform linux/amd64 -p 3000:3000 sqlchat/sqlchat

You can set the following environment variables to customize the deployment:

  • OPENAI_API_KEY: OpenAI API key. You can get one from here.
  • OPENAI_API_ENDPOINT: OpenAI API endpoint. Defaults to https://api.openai.com.
docker run --name sqlchat --platform linux/amd64 --env OPENAI_API_KEY=xxx --env OPENAI_API_ENDPOINT=yyy -p 3000:3000 sqlchat/sqlchat

Local Development

  1. Make a copy of the example environment variables file;

    cp .env.example .env
  2. Add your API key and OpenAI API Endpoint(optional) to the newly created .env file;

  3. Install dependencies and start the dev server;

    pnpm i && pnpm dev

Database Setup

  1. Install dependencies

    pnpm i
  2. Generate prisma client from the model

    pnpm prisma generate
  3. Seed data

    pnpm prisma db seed

Star History

Star History Chart

Community

Hang out on Discord

Follow us on Twitter

sqlchat

Sponsors

License

This project is under the BSL License. See the LICENSE file for the full license text.

FAQ

How to self host SQL Chat?

  • You can deploy SQL Chat to Vercel with one click

    vercel

  • You can deploy your SQL Chat with docker in seconds

    docker run --name sqlchat --platform linux/amd64 -p 3000:3000 sqlchat/sqlchat

How to use my OpenAI API key?

  • You can set the OPENAI_API_KEY in environment variable.

    docker run --name sqlchat --platform linux/amd64 --env OPENAI_API_KEY=xxx -p 3000:3000 sqlchat/sqlchat
  • You can set the OPENAI_API_KEY in setting dialog.

It always says that I have a network connection issue?

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.

sqlchat's People

Contributors

boojack avatar tianzhou avatar correctroadh avatar akrista avatar techdjinn avatar alitrack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.