Member Junction
    Preparing search index...

    RenderPipeline is the one entry point that turns query SQL into the SQL that runs, with enforced ordering and a diagnostic trace. Every path uses it: saved queries, ad hoc SQL, TestQuerySQL, specs and data contexts.

    Pipeline order (a data dependency, not a convention):

    1. Comments are removed first, so template tags in them are inert.
    2. Interpreter gate: a template must pass the MJ Query language check (QueryTemplate.Validate, Refresh mode); a template with errors is refused.
    3. Render, then compose: Nunjucks renders the outer template once. Each composition it reaches records an instance (the composed query + its arguments evaluated in the caller's scope) and writes the instance's CTE name. Each instance then renders on its own, with only its arguments, recursively. The plain SQL is assembled from the rendered parts and is never rendered again, so a value that looks like a template tag stays a value.
    4. Safety: the assembled statement must be a single read query (token-based; see SafetyGate).
    5. Row cap / paging detect ORDER BY and inject TOP / OFFSET-FETCH / LIMIT, after rendering, because {% if SortField %} ORDER BY … {% endif %} decides whether there is an ORDER BY.
    Index

    Constructors

    Methods

    • Resolves only the composition step: the composed queries are rendered with the static arguments written in their composition tokens and assembled as CTEs; the outer SQL itself is not rendered (its own template tags stay as written). For callers that run SQL with compositions but no parameter values (GetData).

      Parameters

      Returns CompositionResult

      Error when a composition of the outer SQL passes a value of the outer query: without rendering there is no value to pass. Use Run for those.