// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ClusterBy } from "./ClusterBy";
import type { Connect } from "./Connect";
import type { DistributeBy } from "./DistributeBy";
import type { Expression } from "./Expression";
import type { Fetch } from "./Fetch";
import type { From } from "./From";
import type { GroupBy } from "./GroupBy";
import type { Having } from "./Having";
import type { Hint } from "./Hint";
import type { Join } from "./Join";
import type { LateralView } from "./LateralView";
import type { Limit } from "./Limit";
import type { Lock } from "./Lock";
import type { NamedWindow } from "./NamedWindow";
import type { Offset } from "./Offset";
import type { OrderBy } from "./OrderBy";
import type { Qualify } from "./Qualify";
import type { Sample } from "./Sample";
import type { SelectInto } from "./SelectInto";
import type { SortBy } from "./SortBy";
import type { Top } from "./Top";
import type { Where } from "./Where";
import type { With } from "./With";

/**
 * Represent a complete SELECT statement.
 *
 * This is the most feature-rich AST node, covering the full surface area of
 * SELECT syntax across 30+ SQL dialects. Fields that are `Option` or empty
 * `Vec` are omitted from the generated SQL when absent.
 *
 * # Key Fields
 *
 * - `expressions` -- the select-list (columns, `*`, computed expressions).
 * - `from` -- the FROM clause. `None` for `SELECT 1` style queries.
 * - `joins` -- zero or more JOIN clauses, each with a [`JoinKind`].
 * - `where_clause` -- the WHERE predicate.
 * - `group_by` -- GROUP BY, including ROLLUP/CUBE/GROUPING SETS.
 * - `having` -- HAVING predicate.
 * - `order_by` -- ORDER BY with ASC/DESC and NULLS FIRST/LAST.
 * - `limit` / `offset` / `fetch` -- result set limiting.
 * - `with` -- Common Table Expressions (CTEs).
 * - `distinct` / `distinct_on` -- DISTINCT and PostgreSQL DISTINCT ON.
 * - `windows` -- named window definitions (WINDOW w AS ...).
 *
 * Dialect-specific extensions are supported via fields like `prewhere`
 * (ClickHouse), `qualify` (Snowflake/BigQuery/DuckDB), `connect` (Oracle
 * CONNECT BY), `for_xml` (TSQL), and `settings` (ClickHouse).
 */
export type Select = { 
/**
 * The select-list: columns, expressions, aliases, and wildcards.
 */
expressions: Array<Expression>, 
/**
 * The FROM clause, containing one or more table sources.
 */
from: From | null, 
/**
 * JOIN clauses applied after the FROM source.
 */
joins: Array<Join>, lateral_views: Array<LateralView>, 
/**
 * ClickHouse PREWHERE clause
 */
prewhere?: Expression | null, where_clause: Where | null, group_by: GroupBy | null, having: Having | null, qualify: Qualify | null, order_by: OrderBy | null, distribute_by: DistributeBy | null, cluster_by: ClusterBy | null, sort_by: SortBy | null, limit: Limit | null, offset: Offset | null, 
/**
 * ClickHouse LIMIT BY clause expressions
 */
limit_by?: Array<Expression> | null, fetch: Fetch | null, distinct: boolean, distinct_on: Array<Expression> | null, top: Top | null, with: With | null, sample: Sample | null, 
/**
 * ClickHouse SETTINGS clause (e.g., SETTINGS max_threads = 4)
 */
settings?: Array<Expression> | null, 
/**
 * ClickHouse FORMAT clause (e.g., FORMAT PrettyCompact)
 */
format?: Expression | null, windows: Array<NamedWindow> | null, hint: Hint | null, 
/**
 * Oracle CONNECT BY clause for hierarchical queries
 */
connect: Connect | null, 
/**
 * SELECT ... INTO table_name for creating tables
 */
into: SelectInto | null, 
/**
 * FOR UPDATE/SHARE locking clauses
 */
locks: Array<Lock>, 
/**
 * T-SQL FOR XML clause options (PATH, RAW, AUTO, EXPLICIT, BINARY BASE64, ELEMENTS XSINIL, etc.)
 */
for_xml?: Array<Expression>, 
/**
 * Leading comments before the statement
 */
leading_comments: Array<string>, 
/**
 * Comments that appear after SELECT keyword (before expressions)
 * e.g., SELECT /*hint*/ col -> post_select_comments: ["/*hint*/"]
 */
post_select_comments?: Array<string>, 
/**
 * BigQuery SELECT AS STRUCT / SELECT AS VALUE kind
 */
kind?: string | null, 
/**
 * MySQL operation modifiers (HIGH_PRIORITY, STRAIGHT_JOIN, SQL_CALC_FOUND_ROWS, etc.)
 */
operation_modifiers?: Array<string>, 
/**
 * Whether QUALIFY appears after WINDOW (DuckDB) vs before (Snowflake/BigQuery default)
 */
qualify_after_window?: boolean, 
/**
 * TSQL OPTION clause (e.g., OPTION(LABEL = 'foo'))
 */
option?: string | null, };
