module Rotor::Cache
The translations of the queries' blocks, kept for the process: a call
whose block was translated over the same models, with captures of the
same kinds (Guard), takes the translation kept and fills in its
parameters. At most LIMIT entries per key, never evicted: the kinds
of several captures multiply (nil or not, a class, an array's items'
class; not an array's length, which the SQL does not depend on), so a
kind beyond them is translated on each build, as before the cache, and
not kept.
/home/runner/work/rotor/rotor/src/cache.qz:231
Constants
LIMIT: Int
The entries a key keeps at most.
CONDITIONS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[Rotor::Sql]]]]
ORDERS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[Rotor::Sql]]]]
PLANS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[Rotor::InnerPlan]]]]
READS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[Array[Array[Rotor::Column]?]]]]]
ASSOCIATIONS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[[Rotor::Association, Symbol]]]]]
SETS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[Array[Rotor::Piece]]]]]
PRELOADS: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[Array[Rotor::Preload]]]]]
MADE: Atom[Int]
How many translations were made (not taken from the cache): for tests.
Class methods
def self.translations -> Int
The number of translations made so far (a call the cache served adds none).
def self.key(site: Int, sources: Array[Rotor::Source]) -> Rotor::CacheKey
The key of a block of site site over sources.
def self.fetch[V <: Shareable](atom: Atom[Hash[Rotor::CacheKey, Array[Rotor::Cached[V]]]], key: Rotor::CacheKey, captures: Array[Object], &make: () -> [V, Array[Rotor::Guard]]) -> V
What atom keeps for key whose guards hold of captures, or else
the block's (a translation, its guards), then kept if the key has
room (LIMIT).