(
state: &DashboardState,
fact_ids: &[i64],
)
| 185 | } |
| 186 | |
| 187 | pub(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 | |
| 209 | pub(crate) async fn graph_bank_rows(state: &DashboardState) -> Result<Vec<Value>, String> { |
| 210 | query_rows( |
no test coverage detected