SQL Idioms and Patterns
CommunityWrite safer, faster, migration-proof SQL
System Documentation
What problem does it solve?
This Skill helps you avoid fragile, unreadable, or inefficient SQL by enforcing idiomatic patterns that remain correct under growth, concurrency, and schema evolution.
Core Features & Use Cases
- Query readability and maintainability: Prefer CTEs over nested subqueries and use explicit JOINs for clear intent.
- Performance and scalability: Use EXPLAIN (ANALYZE, BUFFERS), avoid SELECT *, design indexes (including composite/partial/covering), and choose keyset pagination over OFFSET at scale.
- Migration-safe and correct data operations: Apply idempotent DDL strategies, safe constraint/index creation patterns, UPSERT for race-free updates, and transaction-safe locking patterns.
Example: You are building a task queue and need a query that reliably selects the next pending job under concurrency; this Skill guides you to use SKIP LOCKED, set appropriate timeouts, and structure indexes so throughput stays high as the table grows.
Quick Start
Use the SQL Idioms and Patterns skill to rewrite the provided SQL query to use CTEs, explicit joins, safe parameterization, and index-aware performance improvements while ensuring migration-safe schema changes.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: SQL Idioms and Patterns Download link: https://github.com/irahardianto/awesome-agv/archive/main.zip#sql-idioms-and-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.