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.
npx skills add alirezarezvani/claude-skills --skill sql-database-assistant --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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
- Overview
- Core Capabilities
- Tools
- Natural Language to SQL
- Translation Patterns
- Common Query Templates
- Schema Exploration
- Introspection Queries
- Generating Documentation from Schema
- Query Optimization
- EXPLAIN Analysis Workflow
- Index Recommendation Checklist
- Query Rewriting Patterns
- N+1 Detection
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
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.