# SQL Chat — Chat-Based SQL Client Powered by AI > A chat-based SQL client that converts natural language to SQL queries. Supports MySQL, PostgreSQL, SQL Server, TiDB, and more with a modern conversational interface. ## Install Save in your project root: # SQL Chat — Chat-Based SQL Client Powered by AI ## Quick Use ```bash docker run -p 3000:3000 sqlchat/sqlchat # Or deploy to Vercel / self-host with Node.js ``` ## Introduction SQL Chat is an open-source, chat-based SQL client that lets you query databases using natural language. Instead of writing raw SQL, you describe what you want in plain English and the AI generates and executes the query against your connected database. ## What SQL Chat Does - Converts natural language questions to SQL queries - Connects to MySQL, PostgreSQL, SQL Server, TiDB, and more - Provides an interactive chat interface for iterative data exploration - Shows query results in formatted tables alongside the generated SQL - Maintains conversation context for follow-up questions ## Architecture Overview SQL Chat is a Next.js application with a chat-style frontend. The backend connects to your database via standard drivers and uses OpenAI-compatible APIs for natural language to SQL translation. Database credentials stay local to your deployment and are never sent to external services beyond the LLM provider. ## Self-Hosting & Configuration - Deploy with Docker: `docker run -p 3000:3000 sqlchat/sqlchat` - Or clone the repo and run with `pnpm dev` - Set your OpenAI API key in environment variables - Add database connections through the web UI - Supports environment-based config for team deployments ## Key Features - Natural language to SQL with contextual follow-up queries - Multi-database support including MySQL, PostgreSQL, TiDB, and more - Self-hostable with Docker for data privacy - Schema-aware query generation using database metadata - Conversation history for iterative data exploration ## Comparison with Similar Tools - **Vanna** — Python-based text-to-SQL; SQL Chat offers a ready-to-use web UI - **Chat2DB** — Java-based database client; SQL Chat is lighter with a chat-first design - **DBeaver** — Traditional GUI client; SQL Chat focuses on natural language interaction - **WrenAI** — Semantic layer approach; SQL Chat connects directly to databases ## FAQ **Q: Which LLM providers are supported?** A: OpenAI by default, with support for any OpenAI-compatible API endpoint. **Q: Is my data sent to external servers?** A: Only the schema metadata and your query text go to the LLM. Actual data stays between your deployment and the database. **Q: Can I use it with local LLMs?** A: Yes, point the API endpoint to a local OpenAI-compatible server like Ollama or LiteLLM. **Q: What databases are supported?** A: MySQL, PostgreSQL, SQL Server, TiDB, CockroachDB, ClickHouse, Snowflake, MongoDB, Redis, Oracle, and SQLite. ## Sources - https://github.com/sqlchat/sqlchat - https://www.sqlchat.ai --- Source: https://tokrepo.com/en/workflows/asset-e13ecd64 Author: AI Open Source