(f: &ast::Function)
| 194 | } |
| 195 | |
| 196 | fn function_args_and_distinct(f: &ast::Function) -> (Vec<SqlExpr>, bool) { |
| 197 | let ast::FunctionArguments::List(args) = &f.args else { |
| 198 | return (Vec::new(), false); |
| 199 | }; |
| 200 | let parsed = args |
| 201 | .args |
| 202 | .iter() |
| 203 | .filter_map(|a| match a { |
| 204 | ast::FunctionArg::Unnamed(ast::FunctionArgExpr::Expr(e)) => convert_expr(e).ok(), |
| 205 | ast::FunctionArg::Unnamed(ast::FunctionArgExpr::Wildcard) => Some(SqlExpr::Wildcard), |
| 206 | _ => None, |
| 207 | }) |
| 208 | .collect(); |
| 209 | let distinct = matches!( |
| 210 | args.duplicate_treatment, |
| 211 | Some(ast::DuplicateTreatment::Distinct) |
| 212 | ); |
| 213 | (parsed, distinct) |
| 214 | } |
| 215 | |
| 216 | #[cfg(test)] |
| 217 | mod tests { |
no test coverage detected