Parse a DELETE statement
(mut from: Vec<TableWithJoins>, selection: Option<Expr>)
| 278 | |
| 279 | /// Parse a DELETE statement |
| 280 | fn parse_delete(mut from: Vec<TableWithJoins>, selection: Option<Expr>) -> SqlParseResult<SqlDelete> { |
| 281 | if from.len() == 1 { |
| 282 | match from.swap_remove(0) { |
| 283 | TableWithJoins { |
| 284 | relation: |
| 285 | TableFactor::Table { |
| 286 | name, |
| 287 | alias: None, |
| 288 | args: None, |
| 289 | with_hints, |
| 290 | version: None, |
| 291 | partitions, |
| 292 | }, |
| 293 | joins, |
| 294 | } if joins.is_empty() && with_hints.is_empty() && partitions.is_empty() => Ok(SqlDelete { |
| 295 | table: parse_ident(name)?, |
| 296 | filter: parse_expr_opt(selection)?, |
| 297 | }), |
| 298 | t => Err(SqlUnsupported::DeleteTable(t).into()), |
| 299 | } |
| 300 | } else { |
| 301 | Err(SqlUnsupported::MultiTableDelete.into()) |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | /// Parse a SET variable statement |
| 306 | fn parse_set_var(variable: ObjectName, mut value: Vec<Expr>) -> SqlParseResult<SqlSet> { |
no test coverage detected
searching dependent graphs…