Member Junction
    Preparing search index...

    QueryCompositionEngine reads and resolves {{query:"CategoryPath/QueryName(params)"}} composition tokens.

    Composition itself is render-then-compose (see RenderPipeline.Run): each composed query is rendered with its own arguments and the plain SQL is assembled from the rendered parts. This class keeps the token-reading methods and ResolveComposition, which composes SQL whose compositions take static arguments only, without rendering the outer SQL.

    Index

    Constructors

    Methods

    • Parses all {{query:"..."}} tokens from SQL without resolving them. Useful for dependency extraction during the save pipeline. Only tokens that are SQL count: not those inside a comment, a string literal or a bracket-quoted identifier.

      Uses MJLexer for structured tokenization instead of regex, providing full parsing of category paths, query names, and parameter lists.

      Parameters

      Returns ParsedCompositionToken[]

      Array of parsed token metadata

    • Resolves the composition tokens of sql into CTEs without rendering sql itself: each composed query is rendered with the static arguments its token passes (its own compositions render as usual) and the result is assembled into one statement. The outer SQL's own template tags, if any, stay as written. References resolve by full category path and name only.

      Parameters

      • sql: string

        The SQL containing composition tokens

      • platform: DatabasePlatform

        Target database platform for SQL resolution

      • contextUser: UserInfo

        User context for permission checks on referenced queries

      • Optional_outerParams: Record<string, string>

        Not used: the outer SQL is not rendered, so its compositions take static arguments only. Kept for the signature.

      • OptionalinlineDependencies: QueryDependencySpec[]

        Optional inline dependency specs for transient query testing, searched before the saved queries. Inline dependencies skip governance validation (Reusable, IsApproved, UserCanRun).

      Returns CompositionResult

      CompositionResult with the composed SQL and provenance metadata

      Error if a referenced query is not found, not composable, creates a cycle, or a composition of sql passes a value of the outer query (pass-through)