sql-gen

Translate natural language prompts into executable SQL queries across multiple dialects.

1|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/xukrutdonut/openclaw-skills --skill sql-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-gen
Source: https://github.com/xukrutdonut/openclaw-skills/tree/main/ai-sql
Command: npx skills add https://github.com/xukrutdonut/openclaw-skills --skill sql-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill translates natural language prompts into executable SQL queries, enabling fast data insights without writing SQL manually.

Core Features & Use Cases

  • Natural-language to SQL: Convert English prompts into syntactically correct SQL.
  • Dialect-aware: Supports PostgreSQL, MySQL, SQLite, SQL Server, and Oracle with optional schema context.
  • Ad-hoc analysis: Generate queries for reporting, data exploration, and KPI tracking.

Quick Start

Run a sample: npx ai-sql "top 10 products by revenue last quarter"

Frequently Asked Questions about sql-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert natural language to SQL queries for PostgreSQL or MySQL?

This skill translates natural language prompts into executable SQL queries, supporting multiple dialects including PostgreSQL, MySQL, SQLite, SQL Server, and Oracle. It uses an OpenAI API key and optional schema context to generate optimized, join-aware queries for your specific database.

Do I need an OpenAI API key to generate SQL from text?

Yes, an OpenAI API key is required to generate SQL queries from natural language. The tool requires Node.js 18 or higher and uses the OpenAI API key to produce optimized, executable queries tailored to your specified database dialect.

Can I include database schema context to improve natural language to SQL generation?

Yes, you can include optional schema context to tailor the generated SQL queries for your specific database. Providing schema context ensures the natural language to SQL translation produces optimized, join-aware queries that match your table structures across PostgreSQL, MySQL, SQLite, SQL Server, and Oracle.

Does natural language to SQL generation work with SQLite and SQL Server dialects?

Yes, natural language to SQL generation works with SQLite and SQL Server dialects. The tool supports PostgreSQL, MySQL, SQLite, SQL Server, and Oracle, allowing you to generate syntactically correct, executable queries tailored to your specific database environment.

What is the best way to generate ad-hoc SQL queries for data exploration?

The best way to generate ad-hoc SQL queries for data exploration is using a natural language to SQL generator. By inputting plain English prompts, you can quickly produce executable queries for reporting, data exploration, and KPI tracking without writing SQL manually.