module Rotor::Preloads
Preloading: reading a preload's block, and loading what it names with
one query per association and level (WHERE key = ANY($1), the keys
one array parameter).
/home/runner/work/rotor/rotor/src/preload.qz:8
Class methods
def self.parse(info: Rotor::TableInfo, model: String, expr: Meta::Expr, file: String) -> Array[Rotor::Preload]
The associations the block expr of a preload names, of a model of
table info.
def self.merge(specs: Array[Rotor::Preload]) -> Array[Rotor::Preload]
specs with those of one association made one, their nested ones
merged in turn ([nest(posts) { comments }, posts] is one preload of
posts).
def self.run(repo: Rotor::Repo, models: Array[Rotor::Model], info: Rotor::TableInfo, specs: Array[Rotor::Preload]) -> Array[Hash[Symbol, Array[Rotor::Model]]]
What the repository preloads for models (all of table info): for
each model, by association name, its associated models.