| name | Backend Queries |
| description | Write efficient and secure database queries using parameterized queries, eager loading to prevent N+1 problems, selective column fetching, strategic indexing, transactions for related changes, query timeouts, and caching for expensive queries. Use this skill when writing Eloquent queries or raw SQL, optimizing database performance, preventing N+1 query problems with eager loading, implementing database transactions, adding indexes to improve query speed, or caching frequently-run queries. This skill applies when working with Eloquent query builder, raw database queries, query optimization, or any code that interacts with the database. |
Backend Queries
When to use this skill
- When writing Eloquent queries or using the query builder
- When writing raw SQL queries for complex operations
- When optimizing database performance and query execution time
- When preventing N+1 query problems with eager loading (with(), load())
- When implementing database transactions for data consistency
- When adding indexes to database columns for query optimization
- When caching frequently-run or expensive queries
- When selecting only needed columns instead of using SELECT *
- When implementing query timeouts to prevent runaway queries
- When working with WHERE, JOIN, or ORDER BY clauses
- When debugging slow database queries or performance issues
- When implementing pagination or filtering in API endpoints
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend queries.
Instructions
For details, refer to the information provided in this file: backend queries