MCPcopy Create free account
hub / github.com/codeErrorSleep/dbpaw / format_value

Function format_value

src-tauri/src/mcp/tools/sql.rs:121–136  ·  view source on GitHub ↗
(v: &Value)

Source from the content-addressed store, hash-verified

119}
120
121fn format_value(v: &Value) -> String {
122 match v {
123 Value::Null => "NULL".to_string(),
124 Value::String(s) => {
125 if s.len() > 100 {
126 format!("{}...", &s[..97])
127 } else {
128 s.clone()
129 }
130 }
131 Value::Number(n) => n.to_string(),
132 Value::Bool(b) => b.to_string(),
133 Value::Array(_) => "[array]".to_string(),
134 Value::Object(_) => "{object}".to_string(),
135 }
136}
137
138#[cfg(test)]
139mod tests {

Callers 3

execute_queryFunction · 0.85

Calls

no outgoing calls