# `Selecto.Builder.CteSql`

SQL generation for PostgreSQL Common Table Expressions (CTEs).

Generates SQL for both non-recursive and recursive WITH clauses,
handling dependency ordering, column specifications, and proper
PostgreSQL CTE syntax.

# `build_cte_definition`

Build a single CTE definition SQL.

Returns {cte_definition_iodata, parameters} for a single CTE.

# `build_with_clause`

Build WITH clause SQL from a list of CTE specifications.

Returns {with_clause_iodata, parameters} tuple with properly ordered
CTEs and parameter bindings.

# `create_cte_reference`

Create a CTE reference that can be used in joins and queries.

Returns a structure that represents the CTE as a queryable table.

# `integrate_ctes_with_query`

Integrate CTEs with a main query, combining the WITH clause with the query.

Returns the complete SQL with CTEs at the top.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
