Skip to main content

main_write_split

Function main_write_split 

Source
pub fn main_write_split(
    mutate_plan: &MutatePlan,
    _read_plan: &ReadPlanTree,
    return_representation: bool,
    handler: Option<&MediaHandler>,
    dialect: &dyn SqlDialect,
) -> (SqlBuilder, SqlBuilder)
Expand description

Build split mutation + aggregation statements for backends without DML-in-CTE support.

Returns (mutation, aggregation) where:

  • mutation is the bare INSERT/UPDATE/DELETE with RETURNING
  • aggregation is a SELECT that aggregates rows from _dbrst_mut temp table

The executor is responsible for:

  1. Creating _dbrst_mut temp table from the mutation RETURNING rows
  2. Running the aggregation SELECT