native-query-filter

Combine TypeORM configuration with native SQL get_filtered_list for filtered results and total counts.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mthang1801/go-domain-driven-design --skill native-query-filter
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: native-query-filter
Source: https://github.com/mthang1801/go-domain-driven-design/tree/main/.claude/skills/database/native-query-filter
Command: npx skills add https://github.com/mthang1801/go-domain-driven-design --skill native-query-filter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Integrates TypeORM with native PostgreSQL get_filtered_list to enable dynamic, filterable list APIs with efficient pagination and joins.

Core Features & Use Cases

  • Config-driven filters define a whitelist of allowed keys, ensuring secure and predictable query construction.
  • Performance optimization offloads complex filtering to native SQL for faster responses on large datasets.
  • Use Case: Build admin list endpoints with multi-join filtering and paginated results, while keeping a clean configuration.

Quick Start

Configure the YAML config for your entity, load it with FilteredListBuilder, and call get_filtered_list with the config, filters, and pagination to retrieve results.

Frequently Asked Questions about native-query-filter

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

FAQPage Schema
How do I speed up TypeORM dynamic list queries with complex filtering and pagination?▼

Speed up TypeORM dynamic lists by offloading complex filtering and pagination to native SQL via get_filtered_list, returning filtered data and total counts efficiently on large datasets.

What is the best way to build admin list endpoints with multi-join filtering in TypeORM?▼

The best way to build admin endpoints with multi-join filtering is using a config-driven whitelist of allowed keys combined with native SQL, ensuring secure query construction and fast responses.

Does this native SQL filter approach work with sanitized DTO-based filters?▼

Yes, the native SQL filter approach works with sanitized DTO-based filters by passing a filters map to get_filtered_list alongside a YAML/JSON entity configuration to ensure predictable query construction.

How do I configure TypeORM entities to use native SQL for dynamic filtering?▼

Configure TypeORM entities by defining a YAML/JSON config file for allowed filter keys, then load it with FilteredListBuilder and call get_filtered_list(p_config, p_filters, p_pagination) to retrieve results.

When should I use native SQL instead of ORM for dynamic list queries?▼

Use native SQL instead of ORM when endpoints require complex filtering, pagination, and joins where ORM alone is insufficient or slow, specifically optimizing large dataset responses.

Can I get total counts alongside filtered data using native SQL in TypeORM?▼

Yes, you can get total counts alongside filtered data by calling the native SQL get_filtered_list function, which returns both the filtered dataset and the total_count for pagination.