Agent skill · Databases

sql-database-assistant

Use when the user asks to write SQL queries, optimize database performance, generate migrations, explore database schemas, or work with ORMs like Prisma, Drizzle, TypeORM, or SQLAlchemy.

Alireza Rezvani23,369★ · +428/wk · 1 repos on radarProfile →
claude-codecodexcursorships scriptsMIT
Install
npx skills add alirezarezvani/claude-skills --skill sql-database-assistant --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 7
SKILL.md size: 16 KB
Bundled scripts: yes
Path: engineering/skills/sql-database-assistant/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 23,791 · +422 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# SQL Database Assistant - POWERFUL Tier Skill ## Overview The operational companion to database design. While **database-designer** focuses on schema architecture and **database-schema-designer** handles ERD modeling, this skill covers the day-to-day: writing queries, optimizing performance, generating migrations, and bridging the gap between application code and database engines. ### Core Capabilities - **Natural Language to SQL** — translate requirements into correct, performant queries - **Schema Exploration** — introspect live databases across PostgreSQL, MySQL, SQLite, SQL Server - **Query Optimization** — EXPLAIN analysis, index recommendations, N+1 detection, rewrite patterns - **Migration Generation** — up/down scripts, zero-downtime strategies, rollback plans - **ORM Integration** — Prisma, Drizzle, TypeORM, SQLAlchemy patterns and escape hatches - **Multi-Database Support** — dialect-aware SQL with compatibility guidance ### Tools | Script | Purpose | |--------|---------| | `scripts/query_optimizer.py` | Static analysis of SQL queries for performance issues | | `scripts/migration_generator.py` | Generate migration file templates from change descriptions | | `scripts/sche

What's inside
Steps it walks through
  1. Overview
  2. Core Capabilities
  3. Tools
  4. Natural Language to SQL
  5. Translation Patterns
  6. Common Query Templates
  7. Schema Exploration
  8. Introspection Queries
  9. Generating Documentation from Schema
  10. Query Optimization
  11. EXPLAIN Analysis Workflow
  12. Index Recommendation Checklist
  13. Query Rewriting Patterns
  14. N+1 Detection
Ships with 6 files
  • references/optimization_guide.md
  • references/orm_patterns.md
  • references/query_patterns.md
  • scripts/migration_generator.py
  • scripts/query_optimizer.py
  • scripts/schema_explorer.py
Commands it runs
python scripts/schema_explorer.py --dialect postgres --tables all --format md
python scripts/schema_explorer.py --dialect mysql --tables users,orders --format json --json
python scripts/query_optimizer.py --query "SELECT * FROM orders WHERE status = 'pending'" --dialect postgres
python scripts/query_optimizer.py --query queries.sql --dialect mysql --json
python scripts/migration_generator.py --change "add email_verified boolean to users" --dialect postgres --format sql
python scripts/migration_generator.py --change "rename column name to full_name in customers" --dialect mysql --format alembic --json
Full backup
pg_dump -Fc --no-owner dbname > backup.dump
Restore
pg_restore -d dbname --clean --no-owner backup.dump
More from claude-skills
All skills →
About this skill
What does the sql-database-assistant skill do?

Use when the user asks to write SQL queries, optimize database performance, generate migrations, explore database schemas, or work with ORMs like Prisma, Drizzle, TypeORM, or SQLAlchemy.

How do I install it?

Run `npx skills add alirezarezvani/claude-skills --skill sql-database-assistant --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From alirezarezvani/claude-skills, a repository with 23,791 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going