(arg: &sqlparser::ast::FunctionArg)
| 316 | } |
| 317 | |
| 318 | fn extract_string_literal_arg(arg: &sqlparser::ast::FunctionArg) -> Option<String> { |
| 319 | use sqlparser::ast::{Expr, FunctionArg, FunctionArgExpr, Value}; |
| 320 | let expr = match arg { |
| 321 | FunctionArg::Unnamed(FunctionArgExpr::Expr(e)) => e, |
| 322 | FunctionArg::Named { |
| 323 | arg: FunctionArgExpr::Expr(e), |
| 324 | .. |
| 325 | } => e, |
| 326 | _ => return None, |
| 327 | }; |
| 328 | match expr { |
| 329 | Expr::Value(v) => match &v.value { |
| 330 | Value::SingleQuotedString(s) => Some(s.clone()), |
| 331 | _ => None, |
| 332 | }, |
| 333 | _ => None, |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | #[cfg(test)] |
| 338 | mod tests { |
no test coverage detected