(
scx: &StatementContext,
InsertStatement {
table_name,
columns,
source,
returning,
}: InsertStatement<Aug>,
params: &Params,
)
| 93 | } |
| 94 | |
| 95 | pub fn plan_insert( |
| 96 | scx: &StatementContext, |
| 97 | InsertStatement { |
| 98 | table_name, |
| 99 | columns, |
| 100 | source, |
| 101 | returning, |
| 102 | }: InsertStatement<Aug>, |
| 103 | params: &Params, |
| 104 | ) -> Result<Plan, PlanError> { |
| 105 | let (id, mut expr, returning) = |
| 106 | query::plan_insert_query(scx, table_name, columns, source, returning)?; |
| 107 | expr.bind_parameters_and_simplify_offset(scx, QueryLifetime::OneShot, params)?; |
| 108 | let returning = returning |
| 109 | .expr |
| 110 | .into_iter() |
| 111 | .map(|mut expr| { |
| 112 | expr.bind_parameters_and_simplify_offset(scx, QueryLifetime::OneShot, params)?; |
| 113 | expr.lower_uncorrelated(scx.catalog.system_vars()) |
| 114 | }) |
| 115 | .collect::<Result<Vec<_>, _>>()?; |
| 116 | |
| 117 | Ok(Plan::Insert(InsertPlan { |
| 118 | id, |
| 119 | values: expr, |
| 120 | returning, |
| 121 | })) |
| 122 | } |
| 123 | |
| 124 | pub fn describe_delete( |
| 125 | scx: &StatementContext, |
no test coverage detected