MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / convert_sort_keys

Function convert_sort_keys

nodedb-sql/src/planner/sort.rs:14–25  ·  view source on GitHub ↗

Convert sqlparser OrderByExpr list to SortKey list.

(exprs: &[sqlparser::ast::OrderByExpr])

Source from the content-addressed store, hash-verified

12
13/// Convert sqlparser OrderByExpr list to SortKey list.
14pub 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}

Callers

nothing calls this directly

Calls 3

convert_exprFunction · 0.85
collectMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected