What problem does it solve?
This Skill helps developers diagnose and optimize ORM-generated SQL by translating ORM calls into raw SQL, detecting anti-patterns (like N+1 queries and missing indexes), and providing practical guidance across Node.js, Go, and Python ecosystems.
Core Features & Use Cases
- ORM → SQL conversion: Translate common ORM calls into equivalent SQL for analysis.
- SQL → ORM guidance: Map raw SQL back into ORM patterns for refactoring.
- N+1 detection: Identify N+1 query patterns in logs and suggest eager loading or batching.
- Explain analysis: Interpret EXPLAIN outputs to pinpoint slow operations and indexing gaps.
- Cross-language coverage: Guidance for Sequelize/Prisma/TypeORM (Node.js), GORM/sqlc/sqlx/ent (Go), SQLAlchemy/Django/Peewee (Python).
Quick Start
- Run the query analyzer on your ORM logs: python scripts/query_analyzer.py queries.log
- Pretty-print captured SQL: python scripts/sql_formatter.py "SELECT..."
- See evaluation scenarios in evaluations.json to validate improvements.