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

Function function_name

nodedb-sql/src/aggregate_walk.rs:169–194  ·  view source on GitHub ↗

Return the function name, or a qualified stub that will never match any registered function if the name is schema-qualified. Detection (`contains_aggregate`) uses this to look up the function in the registry — a qualified name won't be found, so the aggregate check is a safe no-op. Extraction (`extract_aggregates`) will not reach this path for schema-qualified names because `convert_expr` rejects

(f: &ast::Function)

Source from the content-addressed store, hash-verified

167/// safe no-op. Extraction (`extract_aggregates`) will not reach this path
168/// for schema-qualified names because `convert_expr` rejects them first.
169fn function_name(f: &ast::Function) -> String {
170 if f.name.0.len() > 1 {
171 // Return a sentinel that cannot match any registry entry.
172 // The actual rejection happens in convert_expr / convert_function_depth.
173 let qualified: String = f
174 .name
175 .0
176 .iter()
177 .map(|p| match p {
178 ast::ObjectNamePart::Identifier(ident) => ident.value.clone(),
179 _ => String::new(),
180 })
181 .collect::<Vec<_>>()
182 .join(".");
183 return format!("__schema_qualified__{qualified}");
184 }
185 f.name
186 .0
187 .iter()
188 .map(|p| match p {
189 ast::ObjectNamePart::Identifier(ident) => normalize_ident(ident),
190 _ => String::new(),
191 })
192 .collect::<Vec<_>>()
193 .join(".")
194}
195
196fn function_args_and_distinct(f: &ast::Function) -> (Vec<SqlExpr>, bool) {
197 let ast::FunctionArguments::List(args) = &f.args else {

Callers 2

pre_visit_exprMethod · 0.70
post_visit_exprMethod · 0.70

Calls 5

normalize_identFunction · 0.85
joinMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected