// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Expression } from "./Expression";
import type { Identifier } from "./Identifier";

/**
 * Represent a single Common Table Expression definition.
 *
 * A CTE has a name (`alias`), an optional column list, and a body query.
 * The `materialized` field maps to PostgreSQL's `MATERIALIZED` /
 * `NOT MATERIALIZED` hints. ClickHouse supports an inverted syntax where
 * the expression comes before the alias (`alias_first`).
 */
export type Cte = { 
/**
 * The CTE name.
 */
alias: Identifier, 
/**
 * The CTE body (typically a SELECT, UNION, etc.).
 */
this: Expression, 
/**
 * Optional column alias list: `cte_name(c1, c2) AS (...)`.
 */
columns: Array<Identifier>, 
/**
 * `Some(true)` = MATERIALIZED, `Some(false)` = NOT MATERIALIZED, `None` = unspecified.
 */
materialized: boolean | null, 
/**
 * USING KEY (columns) for DuckDB recursive CTEs
 */
key_expressions?: Array<Identifier>, 
/**
 * ClickHouse supports expression-first WITH items: WITH <expr> AS <alias>
 */
alias_first: boolean, };
