advanced-filtering-queries

Compose SQLModel select queries with optional where, join, and order_by clauses.

1|Updated Dec 9, 2025
One-click install
npx skills add https://github.com/HezziCode/spec-driven-devlopment-hackathone --skill advanced-filtering-queries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: advanced-filtering-queries
Source: https://github.com/HezziCode/spec-driven-devlopment-hackathone/tree/main/phase-2-fullstack-todo/.claude/skills/advanced-filtering-queries
Command: npx skills add https://github.com/HezziCode/spec-driven-devlopment-hackathone --skill advanced-filtering-queries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It enables you to construct advanced database queries with multiple filters, search terms, sorting, and pagination in a consistent, code-first manner, reducing boilerplate and errors when building listing endpoints.

Core Features & Use Cases

  • Flexible filtering: combine multiple criteria (priority, status, tags, search terms) across user-scoped data.
  • Smart sorting and pagination: provide stable orderings and efficient page navigation for large result sets.
  • Use Case: implement a task list API that supports dynamic query parameters and per-user isolation.

Quick Start

Use the advanced-filtering-queries skill to assemble a dynamic query for a user's tasks with optional search, filters, and sorting.

Frequently Asked Questions about advanced-filtering-queries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build SQLModel queries that support dynamic multi-parameter filtering?

Build dynamic SQLModel queries by composing select statements with optional where, join, and order_by clauses. This conditional composition supports flexible multi-parameter filtering for backend listing endpoints.

How does pagination and sorting work with optional search terms in SQLModel?

Pagination and sorting in SQLModel are handled by composing queries with stable order_by clauses and efficient page navigation. Optional search terms are integrated into where clauses to filter large result sets.

What is the best way to implement per-user data isolation in backend listing endpoints?

Per-user data isolation in listing endpoints is implemented by injecting user-specific conditions into SQLModel where clauses. This ensures dynamic multi-criteria queries only return user-scoped data with safe defaults.

Can I combine multiple criteria like priority, status, and tags in a single SQLModel query?

Yes, you can combine multiple criteria like priority, status, and tags in a single SQLModel query. The query builder dynamically appends where clauses based on provided parameters to filter user-scoped data.

Does this dynamic query building approach work for task list APIs requiring optional filters?

Yes, dynamic query building is designed for task list APIs requiring optional filters. It assembles SQLModel select queries with optional search terms, sorting, and pagination to reduce boilerplate in backend services.

Why do my SQLModel listing endpoints break when sorting large result sets without stable orderings?

Listing endpoints break without stable orderings because pagination relies on consistent row ordering across pages. Providing smart sorting with stable order_by clauses ensures efficient and correct page navigation for large result sets.