Convert sqlparser OrderByExpr list to SortKey list.
(exprs: &[sqlparser::ast::OrderByExpr])
| 12 | |
| 13 | /// Convert sqlparser OrderByExpr list to SortKey list. |
| 14 | pub fn convert_sort_keys(exprs: &[sqlparser::ast::OrderByExpr]) -> Result<Vec<SortKey>> { |
| 15 | exprs |
| 16 | .iter() |
| 17 | .map(|o| { |
| 18 | Ok(SortKey { |
| 19 | expr: convert_expr(&o.expr)?, |
| 20 | ascending: o.options.asc.unwrap_or(true), |
| 21 | nulls_first: o.options.nulls_first.unwrap_or(false), |
| 22 | }) |
| 23 | }) |
| 24 | .collect() |
| 25 | } |
nothing calls this directly
no test coverage detected