oxhq/cachelet-query

Query builder integration for Cachelet.

Maintainers

Package info

github.com/oxhq/cachelet-query

Homepage

Issues

pkg:composer/oxhq/cachelet-query

Statistics

Installs: 4

Dependents: 1

Suggesters: 0

Stars: 0

v0.3.1 2026-05-14 18:26 UTC

This package is auto-updated.

Last update: 2026-05-15 04:25:56 UTC


README

Query builder and Eloquent result caching with Cachelet coordinates.

cachelet-query makes repeated query results inspectable by table, connection, SQL, bindings, pagination inputs, store, prefix, and scope.

Install

composer require oxhq/cachelet-query

Best Fit

Use this package when expensive query results are repeated and the invalidation boundary can be expressed by table, family prefix, tag, or explicit scope.

It provides:

  • cachelet() macros on query builders
  • rememberWithCachelet() convenience macro
  • SQL, binding, connection, and pagination-aware coordinates
  • explicit scope(...) support
  • canonical module = query coordinates and telemetry

Example

$results = User::query()
    ->where('role', 'admin')
    ->cachelet()
    ->ttl(300)
    ->rememberQuery();

Contract

cachelet-query guarantees explicit invalidation by query-table prefix and tags. It does not claim automatic relational invalidation for arbitrary query graphs in 0.2.x.

Docs