Parse a column projection
(expr: Expr)
| 196 | |
| 197 | /// Parse a column projection |
| 198 | pub(crate) fn parse_proj(expr: Expr) -> SqlParseResult<ProjectExpr> { |
| 199 | match expr { |
| 200 | Expr::Identifier(ident) => Ok(ProjectExpr::Var(ident.into())), |
| 201 | Expr::CompoundIdentifier(mut idents) if idents.len() == 2 => { |
| 202 | let table = idents.swap_remove(0).into(); |
| 203 | let field = idents.swap_remove(0).into(); |
| 204 | Ok(ProjectExpr::Field(table, field)) |
| 205 | } |
| 206 | _ => Err(SqlUnsupported::ProjectionExpr(expr).into()), |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | // These types determine the size of [`parse_expr`]'s stack frame on 64-bit targets. |
| 211 | // Changing their sizes will require updating the recursion limit to avoid stack overflows. |
no test coverage detected
searching dependent graphs…