ecto-query-patterns

Official

Build efficient Elixir database queries, effortlessly.

AuthorTheBushidoCollective
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you master Ecto's powerful Query DSL to build efficient, composable database queries in Elixir applications, covering filtering, joining, aggregation, and preloading. It automates the construction of complex and optimized database queries.

Core Features & Use Cases

  • Composable & Dynamic Queries: Build reusable query functions and dynamically construct where clauses based on user input, preventing SQL injection.
  • Efficient Joins & Preloading: Use assoc/2 for clean joins and preload to prevent N+1 query problems, fetching associated data efficiently.
  • Aggregation & Grouping: Perform database-level calculations (count, sum, avg) and group results with group_by and having clauses.
  • Use Case: You need to display a list of blog posts, filtered by category, sorted by publication date, with their authors and the 5 most recent comments preloaded. Use this Skill to construct a single, optimized Ecto query that fetches all this data efficiently, avoiding multiple database round trips and ensuring fast page loads.

Quick Start

Use the ecto-query-patterns skill to write an Ecto query that fetches all Post records where the category is "elixir" and orders them by published_at in descending order.

Dependency Matrix

Required Modules

None required

Components

scriptsreferences

💻 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: ecto-query-patterns
Download link: https://github.com/TheBushidoCollective/han/archive/main.zip#ecto-query-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository