MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / graph_entity_rows

Function graph_entity_rows

src/dashboard/memory_queries.rs:187–207  ·  view source on GitHub ↗
(
    state: &DashboardState,
    fact_ids: &[i64],
)

Source from the content-addressed store, hash-verified

185}
186
187pub(crate) async fn graph_entity_rows(
188 state: &DashboardState,
189 fact_ids: &[i64],
190) -> Result<Vec<Value>, String> {
191 if fact_ids.is_empty() {
192 return Ok(Vec::new());
193 }
194 let placeholders = fact_ids.iter().map(|_| "?").collect::<Vec<_>>().join(",");
195 let sql = format!(
196 "SELECT fe.fact_id, e.entity_id, e.name, e.entity_type
197 FROM memory_fact_entities fe
198 JOIN memory_entities e ON e.entity_id = fe.entity_id
199 WHERE fe.fact_id IN ({placeholders})
200 ORDER BY e.name ASC"
201 );
202 let params: Vec<libsql::Value> = fact_ids
203 .iter()
204 .map(|id| libsql::Value::Integer(*id))
205 .collect();
206 query_rows(&state.mem_conn, &sql, params).await
207}
208
209pub(crate) async fn graph_bank_rows(state: &DashboardState) -> Result<Vec<Value>, String> {
210 query_rows(

Callers 1

graph_payloadFunction · 0.85

Calls 3

query_rowsFunction · 0.85
collectMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected