Selecto.Builder.LateralJoin (Selecto v0.3.8)
SQL generation for LATERAL joins.
This module handles the conversion of LATERAL join specifications into proper PostgreSQL LATERAL JOIN SQL syntax.
Link to this section Summary
Functions
Build a single LATERAL JOIN SQL clause.
Build LATERAL JOIN SQL clauses from specifications.
Integrate LATERAL joins into the main SQL generation pipeline.
Link to this section Functions
Link to this function
build_lateral_join(spec)
Build a single LATERAL JOIN SQL clause.
Link to this function
build_lateral_joins(lateral_specs)
Build LATERAL JOIN SQL clauses from specifications.
Takes a list of LATERAL join specifications and generates the corresponding SQL JOIN clauses with LATERAL keyword and proper correlation handling.
examples
Examples
iex> build_lateral_joins([lateral_spec])
{["LEFT JOIN LATERAL (SELECT ...) AS recent_rentals ON true"], [param1, param2]}
Link to this function
integrate_lateral_joins_sql(base_sql_parts, lateral_specs)
Integrate LATERAL joins into the main SQL generation pipeline.
This function is called by the main SQL builder to include LATERAL JOIN clauses in the generated SQL.