(
sort: &ColumnSort<rq::CId>,
ctx: &mut Context,
)
| 909 | } |
| 910 | |
| 911 | pub(super) fn translate_column_sort( |
| 912 | sort: &ColumnSort<rq::CId>, |
| 913 | ctx: &mut Context, |
| 914 | ) -> Result<OrderByExpr> { |
| 915 | Ok(OrderByExpr { |
| 916 | expr: translate_cid(sort.column, ctx)?.into_ast(), |
| 917 | options: sqlparser::ast::OrderByOptions { |
| 918 | asc: if matches!(sort.direction, SortDirection::Asc) { |
| 919 | None // default order is ASC, so there is no need to emit it |
| 920 | } else { |
| 921 | Some(false) |
| 922 | }, |
| 923 | nulls_first: None, |
| 924 | }, |
| 925 | with_fill: None, |
| 926 | }) |
| 927 | } |
| 928 | |
| 929 | /// Translate a PRQL Ident to a Vec of SQL Idents. |
| 930 | // We return a vec of SQL Idents because sqlparser sometimes uses |
no test coverage detected