MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / response_to_query_result

Function response_to_query_result

nodedb-client/src/native/connection/mod.rs:441–454  ·  view source on GitHub ↗
(resp: NativeResponse)

Source from the content-addressed store, hash-verified

439}
440
441fn response_to_query_result(resp: NativeResponse) -> NodeDbResult<QueryResult> {
442 if resp.status == ResponseStatus::Error {
443 let msg = resp
444 .error
445 .map(|e| e.message)
446 .unwrap_or_else(|| "query failed".into());
447 return Err(NodeDbError::internal(msg));
448 }
449 Ok(QueryResult {
450 columns: resp.columns.unwrap_or_default(),
451 rows: resp.rows.unwrap_or_default(),
452 rows_affected: resp.rows_affected.unwrap_or(0),
453 })
454}
455
456#[cfg(test)]
457mod tests {

Callers 5

execute_sqlMethod · 0.85
execute_ddlMethod · 0.85

Calls 1

internalFunction · 0.50

Tested by 2