sql-gen
Generate SQL queries from natural language
Source facts
- Repository
- lxgicstudios/ai-sql
- Last source activity
- August 21, 2026 at 07:06
- Detected SKILL.md language
- English
- Stars
- 2
- Forks
- 0
Install options
The review-first prompt is selected by default. You can switch to a direct command or download a local copy.
Review the source files
Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.
Showing SKILL.md
SKILL.md
Source instructions · Read-only preview- name
- sql-gen
- description
- Generate SQL queries from natural language
# SQL Generator
Describe what you want, get the SQL. Works with any database.
## Quick Start
```bash
npx ai-sql "get all users who signed up this month and made a purchase"
```
## What It Does
- Converts English to SQL
- Handles complex JOINs
- Adds proper WHERE clauses
- Optimizes for performance
## Usage Examples
```bash
# Generate query
npx ai-sql "top 10 products by revenue last quarter"
# With schema context
npx ai-sql "users without orders" --schema ./schema.sql
# Specific dialect
npx ai-sql "monthly active users" --dialect postgres
```
## Dialects Supported
- PostgreSQL
- MySQL
- SQLite
- SQL Server
- Oracle
## Output Example
```sql
SELECT u.id, u.email, COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.created_at >= DATE_TRUNC('month', CURRENT_DATE)
GROUP BY u.id, u.email
HAVING COUNT(o.id) > 0;
```
## Requirements
Node.js 18+. OPENAI_API_KEY required.
## License
MIT. Free forever.
---
**Built by LXGIC Studios**
- GitHub: [github.com/lxgicstudios/ai-sql](https://github.com/lxgicstudios/ai-sql)
- Twitter: [@lxgicstudios](https://x.com/lxgicstudios)
View on GitHub