text-to-sql

Translate natural-language questions into SQL queries and execute them against databases.

24|2|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/kdoronin/claude_code_skills --skill text-to-sql-kdoronin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: text-to-sql
Source: https://github.com/kdoronin/claude_code_skills/tree/main/text-to-sql
Command: npx skills add https://github.com/kdoronin/claude_code_skills --skill text-to-sql-kdoronin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-dotenv, openpyxl, psycopg2-binary, mysql-connector-python, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Convert natural-language database questions into SQL queries and execute them against SQLite, PostgreSQL, MySQL, and other SQL engines, empowering non-technical users to analyze data quickly.

Core Features & Use Cases

  • Natural-language to SQL conversion for ad hoc querying.
  • Automatic schema extraction and context generation to guide queries.
  • End-to-end project setup: scaffolding, environment configuration, and query execution with result exports.

Quick Start

Initialize a text-to-SQL project, configure a database, extract the schema, and start querying using natural language.

Frequently Asked Questions about text-to-sql

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

FAQPage Schema
How do I convert natural language to SQL queries?

To convert natural language to SQL, this Skill translates your plain-text questions into executable SQL queries and runs them against your database. It scaffolds a project, extracts the schema, and generates context to guide the LLM query conversion.

Can I use natural language to query PostgreSQL and MySQL databases?

Yes, you can query PostgreSQL and MySQL databases using natural language. This Skill supports SQLite, PostgreSQL, and MySQL engines by configuring the connection and extracting the database schema for accurate SQL generation.

How do I extract a database schema for LLM context generation?

You extract a database schema for LLM context generation by initializing a project and running the schema extraction tool. This process produces a markdown context file that guides the language model in generating accurate SQL queries.

What is the best way to set up a text-to-SQL project for data analysis?

The best way to set up a text-to-SQL project is through its guided workflow that initializes scaffolding, configures your environment, and extracts the schema. This allows non-technical users to run ad hoc queries and export database results quickly.

Does natural language to SQL conversion work with server databases?

Yes, natural language to SQL conversion works with server databases. The Python-based toolchain supports connections to server databases like PostgreSQL and MySQL, enabling you to query them directly using natural language inputs.

Do I need Python dependencies to run natural language SQL queries?

Yes, you need specific Python dependencies like psycopg2 and mysql-connector-python to run natural language SQL queries. These packages enable the toolchain to connect to databases, extract schemas, and execute the generated SQL commands.