(expr: &ast::Expr)
| 151 | } |
| 152 | |
| 153 | pub fn extract_string_literal(expr: &ast::Expr) -> Result<String> { |
| 154 | match expr { |
| 155 | ast::Expr::Value(v) => match &v.value { |
| 156 | ast::Value::SingleQuotedString(s) => Ok(s.clone()), |
| 157 | _ => Err(SqlError::Unsupported { |
| 158 | detail: format!("expected string literal, got: {expr}"), |
| 159 | }), |
| 160 | }, |
| 161 | _ => Err(SqlError::Unsupported { |
| 162 | detail: format!("expected string literal, got: {expr}"), |
| 163 | }), |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | pub fn extract_float(expr: &ast::Expr) -> Result<f64> { |
| 168 | match expr { |
no test coverage detected