Member Junction
    Preparing search index...

    Top-level IR node — represents the entire SQL statement structure.

    The composition engine operates on this IR:

    1. Parse raw SQL → QueryIR
    2. Resolve composition refs → add CTEs, replace refs with CTE names
    3. Strip illegal ORDER BYs from CTE bodies
    4. Render QueryIR → SQL string (with {{ }}/{% %} intact)
    interface QueryIR {
        Body: Fragment[];
        CTEs: CTENode[];
        HasUserCTEs: boolean;
        OrderByIsLegalInCTE: boolean;
        TrailingOrderBy: Fragment[] | null;
    }
    Index

    Properties

    Body: Fragment[]

    The main statement body as fragments

    CTEs: CTENode[]

    WITH clause CTEs in dependency order

    HasUserCTEs: boolean

    Whether the original SQL started with a WITH clause

    OrderByIsLegalInCTE: boolean

    Whether the ORDER BY is legal in CTE context (TOP/OFFSET/FOR XML)

    TrailingOrderBy: Fragment[] | null

    Trailing ORDER BY (if detected at top level)