pub fn single_row_values_query(
routines: &dyn RoutineResolution,
insert: &InsertPlan,
observed: impl FnOnce() -> Result<Option<BTreeSet<String>>, SQLError>,
implicit_columns: impl FnOnce() -> Result<Option<Vec<String>>, SQLError>,
) -> Result<Option<InsertPlan>, SQLError>Expand description
The INSERT ... SELECT form of an INSERT whose single VALUES row contains a set-returning call, so the call expands into one inserted row per result as in PostgreSQL. A DEFAULT entry leaves its column out of the target list, where the column default fills it as for an omitted column. Any other INSERT has no such form.
observed names the NEW columns a rewrite rule of the target reads, or None when a rule reads the whole row; it is consulted only for a row that contains a set-returning call. PostgreSQL substitutes each VALUES entry for the NEW references to its column, so a rule action or condition that reads a set-returning entry evaluates it outside any target list and fails. implicit_columns names the target’s columns when the INSERT lists none.