(&self, context: &FunctionContext)
| 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" |
nothing calls this directly
no test coverage detected