SchemaGPT
Talk to your database in plain English. Ask questions, get SQL — instantly.

✨ Features
- 🗣️ Natural Language to SQL — Ask "show all users from last week" and get the query
- 🔌 One-Click Connect — Just add your database credentials, no API keys needed
- 🔍 Auto-Detection — Automatically detects PostgreSQL or MySQL
- 📊 Beautiful Results — View query results in a clean, formatted table
- 🌳 Schema Explorer — Browse tables and columns in the sidebar
- ⚡ Powered by Llama 3.3 — Fast, accurate SQL generation
🚀 Quick Start
1. Install
Search "SchemaGPT" in VS Code Extensions or install from Marketplace
Create a .env file in your workspace root:
DB_HOST=your-database-host.com
DB_PORT=5432
DB_NAME=your_database
DB_USER=your_user
DB_PASSWORD=your_password
DB_SSL=true
That's it! No API key required — SchemaGPT handles AI for you.
3. Connect & Ask
Cmd/Ctrl + Shift + P → "SchemaGPT: Connect to Database"
Cmd/Ctrl + Shift + P → "SchemaGPT: Ask Database Question"
- Type your question in plain English
- View results!
📝 Commands
| Command |
Description |
SchemaGPT: Connect to Database |
Connect using .env credentials |
SchemaGPT: Ask Database Question |
Ask a question in natural language |
SchemaGPT: View Database Schema |
Browse tables and columns |
SchemaGPT: Disconnect Database |
Close the connection |
SchemaGPT: Clear Schema Cache |
Refresh cached schema |
💡 Examples
You ask: "Show me all users who signed up this month"
SchemaGPT generates:
SELECT * FROM users
WHERE created_at >= DATE_TRUNC('month', CURRENT_DATE)
ORDER BY created_at DESC;
You ask: "Top 5 products by revenue"
SchemaGPT generates:
SELECT p.name, SUM(oi.quantity * oi.price) as total_revenue
FROM products p
JOIN order_items oi ON p.id = oi.product_id
GROUP BY p.id, p.name
ORDER BY total_revenue DESC
LIMIT 5;
🗄️ Supported Databases
- ✅ PostgreSQL
- ✅ MySQL
- 🔜 SQLite (coming soon)
⚙️ Configuration
Environment Variables (.env)
# Required
DB_HOST=localhost
DB_PORT=5432
DB_NAME=mydb
DB_USER=postgres
DB_PASSWORD=secret
DB_SSL=true
# Optional - bring your own AI key
# GROQ_API_KEY=your_key (overrides default)
VS Code Settings
{
"schemaGPT.database.host": "localhost",
"schemaGPT.database.port": 5432,
"schemaGPT.database.name": "mydb",
"schemaGPT.database.user": "postgres",
"schemaGPT.database.ssl": true
}
🔒 Security
- ✅ Database passwords stay local (never transmitted)
- ✅ AI queries processed via secure proxy
- ✅ Only your schema structure is sent (no data)
- ✅ SSL/TLS supported for database connections
📋 Requirements
- VS Code 1.85.0+
- PostgreSQL or MySQL database
- Internet connection (for AI processing)
🐛 Known Issues
- Password required on each connection (secure storage coming)
- SELECT queries only by default (safety feature)
📦 Release Notes
v1.1.5
- Secure proxy for AI — no API key needed
- Improved .env file loading
- Better error messages
v1.0.0
- Initial release
- Natural language to SQL
- Schema explorer
- PostgreSQL & MySQL support
🤝 Contributing
Found a bug? Have an idea? Open an issue on GitHub
📄 License
MIT
Made with ❤️ by InjectionAI