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

Function extract_func_args

nodedb-sql/src/planner/select/helpers.rs:73–85  ·  view source on GitHub ↗
(func: &ast::Function)

Source from the content-addressed store, hash-verified

71}
72
73pub fn extract_func_args(func: &ast::Function) -> Result<Vec<ast::Expr>> {
74 match &func.args {
75 ast::FunctionArguments::List(args) => Ok(args
76 .args
77 .iter()
78 .filter_map(|a| match a {
79 ast::FunctionArg::Unnamed(ast::FunctionArgExpr::Expr(e)) => Some(e.clone()),
80 _ => None,
81 })
82 .collect()),
83 _ => Ok(Vec::new()),
84 }
85}
86
87/// Evaluate a constant SqlExpr to a SqlValue. Delegates to the shared
88/// `const_fold::fold_constant` helper so that zero-arg scalar functions

Callers 12

plan_text_from_whereFunction · 0.85
plan_vector_from_whereFunction · 0.85
plan_spatial_from_whereFunction · 0.85
extract_geometry_argFunction · 0.85
extract_float_arrayFunction · 0.85
extract_vector_argFunction · 0.85
extract_text_argFunction · 0.85
extract_graph_score_argsFunction · 0.85
try_extract_sort_searchFunction · 0.85

Calls 3

collectMethod · 0.80
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected