pub struct Prepared<D, Params, Output> { /* private fields */ }Expand description
A query rendered once, with its Value::Placeholder(name) slots left
unresolved, reusable across many .load(executor, params) calls. load
takes the exact Params struct prepare!{} generated for this query, so
a missing or mistyped value is caught. The dialect it was rendered in
stays in its type, so it can only be run by an executor of that dialect,
the same rule Select and DynSelect follow.
Params is a free parameter, though: nothing ties the placeholder names
baked into the template to the struct that fills them. A query built from
one prepare! struct and run with another is therefore caught at
resolve rather than at compile time. Placeholder names are qualified by
the module and struct they were declared in, so that mismatch is always
an UnresolvedPlaceholder and never a value bound to the wrong slot.