MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / execute

Method execute

graphlite/src/functions/string_functions.rs:44–66  ·  view source on GitHub ↗
(&self, context: &FunctionContext)

Source from the content-addressed store, hash-verified

42 }
43
44 fn execute(&self, context: &FunctionContext) -> FunctionResult<Value> {
45 // Get the actual value argument (not column name)
46 let value = context.get_argument(0)?;
47
48 if value.is_null() {
49 return Ok(Value::Null);
50 }
51
52 // Handle both strings and numbers - convert to string first
53 let string_val = if let Some(s) = value.as_string() {
54 s.to_string()
55 } else if let Some(n) = value.as_number() {
56 n.to_string()
57 } else {
58 // Try to convert other types to string representation
59 match value {
60 Value::Boolean(b) => b.to_string(),
61 _ => return Ok(Value::Null), // Return null for non-convertible types
62 }
63 };
64
65 Ok(Value::String(string_val.to_uppercase()))
66 }
67
68 fn return_type(&self) -> &str {
69 "String"

Callers

nothing calls this directly

Calls 11

get_argumentMethod · 0.80
is_nullMethod · 0.80
as_numberMethod · 0.80
extract_trim_charMethod · 0.80
containsMethod · 0.80
as_stringMethod · 0.45
lenMethod · 0.45
value_to_stringMethod · 0.45
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected