ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

sql-gen

Generate SQL queries from natural language

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/lxgicstudios/ai-sql
Or

SQL Generator

Describe what you want, get the SQL. Works with any database.

Quick Start

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

# 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

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

Metadata

Stars1601
Views0
Updated2026-02-27
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-lxgicstudios-ai-sql": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.