Member Junction
    Preparing search index...

    What the paging and row-cap steps need to know about a statement, read from tokens so it works on SQL the AST parser cannot read. All offsets are positions in PagingShape.Statement.

    interface PagingShape {
        CTEs: LeadingCTEs | null;
        IsDistinct: boolean;
        IsSetOperation: boolean;
        MainStart: number;
        OrderBy: { End: number; Start: number } | null;
        OwnCaps: OwnRowCap[];
        ReturnsDocument: "xml" | "json" | null;
        SelectListStart: number | null;
        Statement: string;
        TailStart: number;
    }
    Index

    Properties

    CTEs: LeadingCTEs | null

    The leading WITH clause, split by position; null when there is none.

    IsDistinct: boolean

    Whether the main statement is SELECT DISTINCT.

    IsSetOperation: boolean

    Whether the main statement is a UNION / INTERSECT / EXCEPT.

    MainStart: number

    Where the main statement (after any leading CTEs) starts.

    OrderBy: { End: number; Start: number } | null

    The main statement's last top-level ORDER BY, from the keyword to the end of its list.

    OwnCaps: OwnRowCap[]

    The caps the main statement itself carries, at its top level, in order.

    ReturnsDocument: "xml" | "json" | null

    A top-level FOR JSON or FOR XML, which makes the statement return a document, not rows.

    SelectListStart: number | null

    Offset just after the main statement's first top-level SELECT [ALL | DISTINCT], where a TOP n would go; null when the statement has no top-level SELECT (it is parenthesized, or a bare VALUES list).

    Statement: string

    The statement analysed.

    TailStart: number

    Where a trailing clause that must stay last starts: OPTION (…) on SQL Server, FOR UPDATE / FOR SHARE on PostgreSQL. Equal to the statement length when there is none.