pub fn resolve_scalars(
ast: &Ast,
catalog: &dyn ScalarCatalog,
) -> Result<Ast, BuildError>Expand description
Resolve every scalar-flagged correlated subquery in ast (its WHERE tree and,
recursively, every nested subquery and related child) against catalog,
returning a rewritten AST in which each fold has replaced its EXISTS/NOT EXISTS
condition with a plain Simple condition (so the builder emits no join for it).
Conditions without the flag are untouched, so an AST with no scalar: true
anywhere round-trips unchanged.
Errors (design ยง7: a flagged scalar that cannot be proven single-row is loud, not a silent live fallback):
BuildError::UnknownTableโ the child table is not incatalog.BuildError::Unsupportedโ the precondition fails (the childWHEREdoes not bind exactly a unique key), or this shape is not yet folded (e.g. a compound-correlationNOT EXISTS).BuildError::UnknownColumnโ a correlation/key column is absent from the schema.