Selecto.Builder.CteSql
(Selecto v0.4.5)
Copy Markdown
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.
Summary
Functions
Build a single CTE definition SQL.
Build WITH clause SQL from a list of CTE specifications.
Create a CTE reference that can be used in joins and queries.
Integrate CTEs with a main query, combining the WITH clause with the query.
Functions
Build a single CTE definition SQL.
Returns {cte_definition_iodata, parameters} for a single CTE.
Build WITH clause SQL from a list of CTE specifications.
Returns {with_clause_iodata, parameters} tuple with properly ordered CTEs and parameter bindings.
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 a main query, combining the WITH clause with the query.
Returns the complete SQL with CTEs at the top.