create-grid-query-builder

create-grid-query-builder is a skill for Claude Code, Codex from jeffsenso/prestashop-skills. It costs 55 tokens per session (757 once invoked), scanned A, original, MIT.

A guide for creating the database query used to fill a PrestaShop grid, including filtering, sorting, pagination, and the total row count.

In plain words
What is it for?
Writing Doctrine DBAL queries for grid rows, applying search filters and ordering, limiting results to the current page, joining language tables, and optionally post-processing the data.
Why use it?
It ensures the query returns the exact column names expected by the grid and handles search results separately from the count of all matching rows.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Writing Doctrine DBAL queries for grid rows, applying search filters and ordering, limiting results to the current page, joining language tables, and optionally post-processing the data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jeffsenso/prestashop-skills/create-grid-query-builder
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jeffsenso/prestashop-skills --skill create-grid-query-builder
Clone the repo
git clone --depth 1 https://github.com/jeffsenso/prestashop-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create-grid-query-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/jeffsenso/prestashop-skills/create-grid-query-builder/github.svg)](https://agentmods.dev/skills/jeffsenso/prestashop-skills/create-grid-query-builder)
Your own site
<a href="https://agentmods.dev/skills/jeffsenso/prestashop-skills/create-grid-query-builder"><img src="https://agentmods.dev/badge/skills/jeffsenso/prestashop-skills/create-grid-query-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for create-grid-query-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/jeffsenso/prestashop-skills/create-grid-query-builder"><img src="https://agentmods.dev/badge/skills/jeffsenso/prestashop-skills/create-grid-query-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 757 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.00757
Opus 5 $0.00028 $0.00378
Sonnet 5 $0.00011 $0.00151
Haiku 4.5 $0.00006 $0.00076

Measured 9d ago against content hash b7da5aa4095a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

create-grid-query-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/prestashop-module-development/ps9-core-ai/Component/Grid/skills/create-grid-query-builder/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

create-grid-query-builder

Read @.ai/Component/Grid/CONTEXT.md for the factory trilogy and GridDataFactory decoration pattern.

1. Query Builder

Create src/Adapter/{Domain}/Grid/Query/{Domain}QueryBuilder.php implementing DoctrineQueryBuilderInterface or extending AbstractDoctrineQueryBuilder:

Two required methods:

  • getSearchQueryBuilder(SearchCriteriaInterface $searchCriteria): QueryBuilder — returns rows for the current page
  • getCountQueryBuilder(SearchCriteriaInterface $searchCriteria): QueryBuilder — returns total count (no LIMIT/OFFSET)

Building the query

  1. Base query: SELECT c.id_{domain}, c.name, c.active FROM ps_{domain} c
  2. For each filter in $searchCriteria->getFilters(), add a WHERE clause with parameterized values
  3. Apply sorting: map $searchCriteria->getOrderBy() to actual column expressions
  4. Apply pagination: ->setFirstResult($offset)->setMaxResults($limit) (search query only, not count)
  5. For multilingual columns: LEFT JOIN the _lang table with the current language ID

Reference: src/Core/Grid/Query/LanguageQueryBuilder.php (simple), src/Adapter/Manufacturer/QueryBuilder/ManufacturerQueryBuilder.php (with joins)

2. GridDataFactory (standard)

For most grids, the standard DoctrineGridDataFactory is sufficient — it calls the query builder automatically. Just wire it in DI:

prestashop.core.grid.data.factory.{domain}:
    class: 'PrestaShop\PrestaShop\Core\Grid\Data\Factory\DoctrineGridDataFactory'
    arguments:
        - '@prestashop.core.admin.{domain}.query_builder'
        # ... hook dispatcher, query parser, etc.

3. GridDataFactory decorator (if post-processing needed)

When grid data needs transformation after query execution (e.g. resolving image URLs from IDs, formatting computed columns), create a decorator:

  • Create a class implementing GridDataFactoryInterface
  • Inject the original GridDataFactory
  • In getData(SearchCriteriaInterface $searchCriteria): call the wrapped factory, then modify the RecordCollection
  • Register with decorates: in DI YAML

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 78 lines · 55 tokens per session scan A b7da5aa4095a

Subscribe to this mod's changes

create-grid-query-builder is a skill published in the GitHub repository jeffsenso/prestashop-skills (5 stars, last pushed 15d ago), licensed MIT. It adds 55 tokens to every session and 757 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

055-design-parallel-change

Use when a database schema or data-meaning change needs Parallel Change, including expand, migrate, and contract sequencing for column renames, type or data reinterpretation, large-table backfills, relationship-table changes, enum/status transitions, timezone/default changes, and index or uniqueness changes. This…

jabrena/plinth · 94 tokens

313-frameworks-spring-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Spring Boot application — Maven dependencies, db/migration scripts, spring.flyway. configuration, baseline and validation, and alignment with JDBC or Spring Data JDBC. This should trigger for requests such as Add or review Flyway migrations in a Spring…

jabrena/plinth · 120 tokens

316-frameworks-spring-mongodb-migrations-mongock

Use when you need to add or review Mongock MongoDB data migrations in a Spring Boot application — including Maven coordinates, Spring Data MongoDB drivers, migration scan packages, @ChangeUnit classes, lock/transaction settings, and optional policy-approved MongoDB integration verification. This should trigger for…

jabrena/plinth · 125 tokens

413-frameworks-quarkus-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Quarkus application — quarkus-flyway extension, db/migration scripts, quarkus.flyway. configuration, migrate-at-start, and alignment with JDBC or Panache. This should trigger for requests such as Add or review Flyway migrations in a Quarkus project…

jabrena/plinth · 136 tokens

416-frameworks-quarkus-mongodb-migrations-mongock

Use when you need to add or review Mongock MongoDB data migrations in a Quarkus application — including the Quarkiverse Mongock extension, Quarkus MongoDB client configuration, migrate-at-start, @ChangeUnit classes, lock/transaction settings, and Quarkus test verification. This should trigger for requests such as Add…

jabrena/plinth · 135 tokens

513-frameworks-micronaut-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Micronaut application — micronaut-flyway, db/migration scripts, flyway.datasources. configuration, and alignment with JDBC or Micronaut Data. This should trigger for requests such as Add or review Flyway migrations in a Micronaut project; Configure…

jabrena/plinth · 129 tokens