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

Function query_rows

src/dashboard/util.rs:47–54  ·  view source on GitHub ↗

Runs a query and collects all rows as JSON objects. On SQL errors returns the error message so handlers can surface it in the payload's `error` field (mirroring the Python APIs, which never 500 on a bad/missing DB).

(
    conn: &Connection,
    sql: &str,
    params: impl libsql::params::IntoParams,
)

Source from the content-addressed store, hash-verified

45/// the error message so handlers can surface it in the payload's `error`
46/// field (mirroring the Python APIs, which never 500 on a bad/missing DB).
47pub(crate) async fn query_rows(
48 conn: &Connection,
49 sql: &str,
50 params: impl libsql::params::IntoParams,
51) -> std::result::Result<Vec<Value>, String> {
52 let rows = conn.query(sql, params).await.map_err(|e| e.to_string())?;
53 collect_rows(rows).await.map_err(|e| e.to_string())
54}
55
56/// Runs a scalar `SELECT COUNT(*)`-style query; errors and missing rows
57/// collapse to 0 (these feed overview cards, not critical paths).

Callers 15

overview_role_countsFunction · 0.85
overview_source_countsFunction · 0.85
overview_depth_countsFunction · 0.85
latest_sessionsFunction · 0.85
latest_summary_nodesFunction · 0.85
overview_message_matchesFunction · 0.85
search_message_ftsFunction · 0.85
search_message_likeFunction · 0.85
search_node_ftsFunction · 0.85
search_node_likeFunction · 0.85

Calls 1

collect_rowsFunction · 0.70

Tested by

no test coverage detected