| Recommend this page to a friend! |
| Packages of Mohamed Abdulalim | Persistence | docs/adr/0001-pdo-pagination-architecture.md | Download |
|
|||||||||||||||||||||
ADR 0001: PDO Pagination Architecture
ContextMaatify host projects repeatedly implement the same PDO offset-pagination mechanics across repositories and query readers. The duplicated concerns include page normalization, per-page limits, count execution, deterministic sorting, safe public sort keys, The repeated mechanics are persistence concerns, but host repositories must retain ownership of domain SQL, mandatory scopes, optional filters, search rules, authorization constraints, and row mapping. DecisionA new additive package domain will be introduced under:
The Pagination domain will be separate from the existing Ordering domain. It must not alter the public API, transaction behavior, or Runtime semantics of Consuming repository responsibilitiesThe consuming repository or query reader owns:
Package responsibilitiesThe package owns:
Explicit non-goalsThe package will not become:
Detailed ContractThe exact public types, signatures, validation rules, SQL boundaries, exception classifications, result invariants, and MySQL verification requirements are owned by the PDO Pagination Contract. The contract has been implemented and released in Alternatives ConsideredHost-local pagination implementationsRejected as the long-term architecture because they duplicate persistence mechanics and create inconsistent normalization, sorting, and metadata behavior. A package-owned Query Builder or filter engineRejected because it would move domain SQL ownership into the shared package and expand the package toward ORM or framework territory. Adding Pagination methods to Ordering classesRejected because Ordering and Pagination are separate persistence domains with different contracts and responsibilities. Consequences
|