[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71391":3},{"id":4,"name":5,"fullName":6,"owner":5,"repo":5,"description":7,"homepage":8,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":43,"readmeContent":44,"aiSummary":45,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":46,"discoverSource":47},71391,"sqlchat","sqlchat\u002Fsqlchat","Chat-based SQL Client and Editor for the next decade","https:\u002F\u002Fsqlchat.ai",null,"TypeScript",5793,502,36,21,0,2,20,67.1,"MIT License",false,"main",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"chatgpt","clickhouse","cockroachdb","gpt","mongodb","mssql","mysql","openai","oracle","postgres","redis","snowflake","sql","sqlclient","sqleditor","sqlite","sqlserver","text-to-sql","text2sql","tidb","2026-06-12 04:01:00","![SQL Chat banner](https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Fbanner.webp)\n\n\u003Cdiv align=\"center\">\n  \u003Ch3>SQL Chat\u003C\u002Fh3>\n  \u003Ca href=\"https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fsqlchat%2Fsqlchat&env=OPENAI_API_KEY\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdeploy%20on-Vercel-brightgreen.svg?style=for-the-badge&logo=vercel\" alt=\"vercel\">\n  \u003C\u002Fa>\n  \u003Cp>English | \u003Ca href=\"README.zh-CN.md\">中文\u003C\u002Fa> | \u003Ca href=\"README.es-ES.md\">Español\u003C\u002Fa>\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n## What\n\nSQL Chat is a chat-based SQL client, which uses natural language to communicate with the database to implement operations such as query, modification, addition, and deletion of the database.\n\n![Screenshot](https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Fscreenshot1.webp)\n\n![Screenshot](https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Fscreenshot2.webp)\n\n![Screenshot](https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Fscreenshot3.webp)\n\n## Why\n\nAs we enter the [Developer Tools 2.0 era](https:\u002F\u002Fwww.sequoiacap.com\u002Farticle\u002Fai-powered-developer-tools\u002F),\nthere is a massive opportunity to rebuild the existing tools using the chat-based interface. SQL Client\nis no exception. Instead of navigating across many UI controls, a chat-based interface is much\nmore intuitive. Of course, only if that works, and our goal is to deliver that experience.\n\n## How\n\nSQL Chat is built by [Next.js](https:\u002F\u002Fnextjs.org\u002F), it supports the following databases and will add more over time:\n\n- MySQL\n- PostgreSQL\n- MSSQL\n- TiDB Cloud\n- OceanBase\n\n## [sqlchat.ai](https:\u002F\u002Fsqlchat.ai)\n\n### IP Whitelisting\n\nIf you use [sqlchat.ai](https:\u002F\u002Fsqlchat.ai) to connect to your database, you need to add 0.0.0.0 (allow all connections)\nto the database whitelist IP. Because sqlchat.AI is hosted on [Vercel](https:\u002F\u002Fvercel.com\u002F) which [uses dynamic IP](https:\u002F\u002Fvercel.com\u002Fguides\u002Fhow-to-allowlist-deployment-ip-address). If this is a concern, please consider the self-host option below.\n\n### Data Privacy\n\nSee [SQL Chat Privacy Policy](https:\u002F\u002Fsqlchat.ai\u002Fprivacy).\n\n## Self-host\n\n### Docker\n\nIf you just want to run for your own use, supply the following options:\n\n- `NEXTAUTH_SECRET`\n- `OPENAI_API_KEY`\n\n```bash\ndocker run --name sqlchat --platform linux\u002Famd64 --env NEXTAUTH_SECRET=\"$(openssl rand -hex 5)\" --env OPENAI_API_KEY=\u003C\u003CYOUR OPENAI KEY>> -p 3000:3000 --hostname localhost sqlchat\u002Fsqlchat\n```\n\n- Pass an arbitrary string to NEXTAUTH_SECRET otherwise next-auth will complain.\n- If you chat to the database on the same host, you need to use `host.docker.internal` as the host in\n  the database connection setting.\n\n\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fdocs\u002Fdocker-connection-setting.webp\" \u002F>\n\n## Startup options\n\n## TL;DR\n\n- If you just want to use for yourself, then run without database. Check [.env.nodb](https:\u002F\u002Fgithub.com\u002Fsqlchat\u002Fsqlchat\u002Fblob\u002Fmain\u002F.env.nodb).\n- If you want to offer a similar service as [sqlchat.ai](https:\u002F\u002Fsqlchat.ai), then run with database, check [.env.usedb](https:\u002F\u002Fgithub.com\u002Fsqlchat\u002Fsqlchat\u002Fblob\u002Fmain\u002F.env.usedb). The database is used to store account, usage info.\n\n### OpenAI related\n\n- `OPENAI_API_KEY`: OpenAI API key. You can get one from [here](https:\u002F\u002Fplatform.openai.com\u002Fapi-keys).\n\n- `OPENAI_API_ENDPOINT`: OpenAI API endpoint. Defaults to `https:\u002F\u002Fapi.openai.com`. Use [Ollama](https:\u002F\u002Fgithub.com\u002Follama\u002Follama) to set up self-host AI model and set the endpoint to it.\n\n- `NEXT_PUBLIC_ALLOW_SELF_OPENAI_KEY`: Set to `true` to allow users to bring their own OpenAI API key.\n\n\n### Database related\n\n- `NEXT_PUBLIC_USE_DATABASE`: Set to `true` to start SQL Chat with database. This will\n  enable following features:\n  1. Account system.\n  1. Per-user quota enforcement.\n  1. Payment.\n  1. Usage data collection.\n- `DATABASE_URL`: Applicable if `NEXT_PUBLIC_USE_DATABASE` is `true`. Postgres connection string to store data. e.g. `postgresql:\u002F\u002Fpostgres:YOUR_PASSWORD@localhost:5432\u002Fsqlchat?schema=sqlchat`.\n\n## Local Development\n\n1. Install dependencies\n\n   ```bash\n   pnpm i\n   ```\n\n1. Generate prisma client\n\n   ```bash\n   pnpm prisma generate\n   ```\n\n1. Make a copy of the example environment variables file:\n\n   ```bash\n   cp .env.usedb .env\n   ```\n\n1. Add your [API key](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys) and OpenAI API Endpoint(optional) to the newly created `.env` file.\n\n### Setup database\n\n**You can skip this section with `NEXT_PUBLIC_USE_DATABASE=false` if you don't build features requiring database**\n\n1. Start a Postgres instance. For mac, you can use [StackbBricks](https:\u002F\u002Fstackbricks.app\u002F), [DBngin](https:\u002F\u002Fdbngin.com\u002F) or [Postgres.app](https:\u002F\u002Fpostgresapp.com\u002F).\n\n1. Create a database:\n\n   ```sql\n   CREATE DATABASE sqlchat;\n   ```\n\n   In `.env` file, assign the connection string to environment variable `DATABASE_URL` and `DATABASE_DIRECT_URL`. [This article](https:\u002F\u002Fwww.prisma.io\u002Fdocs\u002Fdata-platform\u002Fdata-proxy\u002Fprisma-cli-with-data-proxy#set-a-direct-database-connection-url-in-your-prisma-schema) explains why we need two URLs.\n\n1. Set up database schema\n\n   ```bash\n   pnpm prisma migrate dev\n   ```\n\n1. (Optional) Seed data\n\n   ```bash\n   pnpm prisma db seed\n   ```\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=sqlchat\u002Fsqlchat&type=Date)](https:\u002F\u002Fstar-history.com\u002F#sqlchat\u002Fsqlchat&Date)\n\n## Community\n\n[![Follow us on Twitter](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FFollow%20us%20on%20Twitter-1DA1F2?style=for-the-badge&logo=twitter&labelColor=EEEEEE)](https:\u002F\u002Ftwitter.com\u002FBytebase)\n\n\u003Cimg width=\"256\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Fwechat-qrcode.webp\" alt=\"sqlchat\">\n\n## Sponsors\n\n\u003Cp>\n  \u003Ca href=\"https:\u002F\u002Fwww.bytebase.com\">\n    \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Fbytebase.webp\" width=300>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n## Common Error Message\n\n\u003Cdetails>\u003Csummary>Please sign up to get free quota\u003C\u002Fsummary>\n\u003Cp>\n\nSee [this issue](https:\u002F\u002Fgithub.com\u002Fsqlchat\u002Fsqlchat\u002Fissues\u002F141).\n\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\u003Cdetails>\u003Csummary>You exceeded your current quota, please check your plan and billing details\u003C\u002Fsummary>\n\u003Cp>\n\n![openai quota](https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Ferror-exceed-openai-quota.webp)\n\nYour OpenAI Key has run out of quota. Please check your [OpenAI account](https:\u002F\u002Fplatform.openai.com\u002Faccount\u002Fapi-keys).\n\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\u003Cdetails>\u003Csummary>Failed to request message, please check your network\u003C\u002Fsummary>\n\u003Cp>\n\n![network error](https:\u002F\u002Fraw.githubusercontent.com\u002Fsqlchat\u002Fsqlchat\u002Fmain\u002Fpublic\u002Ferror-network.webp)\n\nPlease make sure you have a stable network connection which can access the OpenAI API endpoint.\n\n```bash\nping api.openai.com\n```\n\nIf you cannot access the OpenAI API endpoint, you can try to set the `OPENAI_API_ENDPOINT` in UI or environment variable.\n\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n","SQL Chat 是一个基于聊天界面的SQL客户端和编辑器，通过自然语言与数据库交互来执行查询、修改、添加和删除等操作。项目采用TypeScript编写，并利用了Next.js框架构建，支持包括MySQL、PostgreSQL、MSSQL在内的多种数据库，并计划持续增加对更多类型的支持。其核心功能是将复杂的SQL命令转换为简单的对话形式，极大地简化了数据库管理过程中的用户交互体验。适用于需要频繁进行数据库操作但又希望减少学习成本或提高工作效率的场景，如开发测试环境下的快速原型验证、日常运维中的数据查询与维护等。","2026-06-11 03:37:31","high_star"]