prorm API Reference
    Preparing search index...

    Interface CTEOptions

    Common Table Expression (CTE) options Used for WITH RECURSIVE and regular WITH clauses

    interface CTEOptions {
        name: string;
        columns?: string[];
        query: string | Record<string, unknown>;
        recursive?: boolean;
    }
    Index
    name: string

    Name of the CTE

    columns?: string[]

    Column names for the CTE (optional)

    query: string | Record<string, unknown>

    The CTE body. Prefer a structured query object (same shape as SelectOptions in src/dialects/dialect.ts: tableName, where, attributes, order, etc.) over a raw SQL string wherever possible - a plain string is only meant as an escape hatch for CTE bodies that can't be expressed structurally (e.g. hand-written recursive UNION ALL logic referencing the CTE's own name).

    recursive?: boolean

    Whether this is a recursive CTE