(state: &DashboardState, limit: i64)
| 57 | } |
| 58 | |
| 59 | pub(crate) async fn entity_rows(state: &DashboardState, limit: i64) -> Result<Vec<Value>, String> { |
| 60 | query_rows( |
| 61 | &state.mem_conn, |
| 62 | "SELECT e.entity_id, e.name, e.entity_type, e.aliases, e.created_at, |
| 63 | COUNT(fe.fact_id) AS fact_count |
| 64 | FROM memory_entities e |
| 65 | LEFT JOIN memory_fact_entities fe ON fe.entity_id = e.entity_id |
| 66 | GROUP BY e.entity_id |
| 67 | ORDER BY fact_count DESC, e.name ASC |
| 68 | LIMIT ?1", |
| 69 | libsql::params![limit], |
| 70 | ) |
| 71 | .await |
| 72 | } |
| 73 | |
| 74 | pub(crate) async fn trust_histogram_rows(state: &DashboardState) -> Result<Vec<Value>, String> { |
| 75 | query_rows( |
no test coverage detected