← ClaudeAtlas

text-to-sqllisted

Setup and use text-to-SQL capabilities for SQL databases (SQLite, PostgreSQL, MySQL, MariaDB, etc.). Use when: (1) User wants to query databases using natural language, (2) User asks to setup text-to-sql project, (3) User mentions extracting data from database, (4) User has .sqlite/.db file or database credentials and wants to work with data. This skill sets up project structure, extracts database schema, and enables natural language to SQL conversion.
nicholyx/ai-skills · ★ 6 · API & Backend · score 75
Install: claude install-skill nicholyx/ai-skills
# Text-to-SQL Skill Convert natural language questions into SQL queries and execute them against SQL databases. ## Phase 1: Project Setup ### Step 1: Ask about database connection Ask user which database type they want to use: **Option A: SQLite** (file-based, no credentials needed) - User provides path to `.sqlite` or `.db` file - Or places file in `database/` folder **Option B: Server database** (PostgreSQL, MySQL, MariaDB, etc.) - User creates `.env` file with connection details - Supported: PostgreSQL, MySQL, MariaDB, and other SQL databases ### Step 2: Initialize project structure Run the init script OR manually create structure: **Option A: Use init script** ```bash python scripts/init_project.py --target /path/to/project ``` **Option B: Manual setup** ```bash mkdir -p database output/queries output/reports ``` Copy from skill folders to project root: - `scripts/*.py` → project root (db_extractor.py, query_runner.py, list_databases.py, sql_helper.py) - `assets/example.env` → project root - `assets/requirements.txt` → project root - `assets/.gitignore` → project root Install dependencies: ```bash pip install -r requirements.txt ``` ### Step 3: Configure connection **For SQLite:** ```bash # Place database file cp /path/to/database.sqlite database/ # Extract schema python db_extractor.py --sqlite database/YOUR_DB.sqlite ``` **For server databases (PostgreSQL, MySQL, etc.):** Copy and edit the template: ```bash cp example.env .env # Edit .env with actual cr