Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DQR-003Data / Query RiskUnbounded query risk without limit/pagination evidence
Flags list/query paths without obvious limit or pagination controls.
warningviolationNo auto-fix
How to fix
- Add limit and pagination parameters.
- Set a maximum page size.
- For exports, move heavy reads to an explicit export workflow with operational safeguards.
What the rule validates
A query path can return an unbounded number of rows.
Why it matters
Unbounded queries can degrade production systems and create unpredictable API behavior.
Common causes
- A list endpoint was added without pagination.
- A batch export reuses online request code.
- The limit is applied in a layer ArchPilot cannot see.
Typical violation example
findMany({ where: { organizationId } })Typical compliant example
findMany({ where: { organizationId }, take: pageSize, skip: offset })Related rules
AP-DQR-001 - Missing tenant filter evidence in multi-tenant SQLAP-DQR-002 - Broad SELECT * usage in query pathAP-DQR-004 - Cross-module direct database access bypasses module boundaryAP-DQR-005 - N+1 query evidence in collection loop
Adjacent categories
Related files/config
apps/api/srcpackages/db/prisma/schema.prisma
Related CLI commands
archpilot validatearchpilot validate --ci
Related docs