MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / list_children

Method list_children

crates/opencode-storage/src/repository.rs:343–361  ·  view source on GitHub ↗
(&self, parent_id: &str)

Source from the content-addressed store, hash-verified

341 }
342
343 pub async fn list_children(&self, parent_id: &str) -> Result<Vec<Session>, DatabaseError> {
344 let rows = sqlx::query_as::<_, SessionRow>(
345 r#"SELECT
346 id, project_id, parent_id, slug, directory, title, version, share_url,
347 summary_additions, summary_deletions, summary_files, summary_diffs,
348 revert, permission,
349 usage_input_tokens, usage_output_tokens, usage_reasoning_tokens,
350 usage_cache_write_tokens, usage_cache_read_tokens, usage_total_cost,
351 status, created_at, updated_at, time_compacting, time_archived
352 FROM sessions WHERE parent_id = ?
353 ORDER BY created_at DESC"#,
354 )
355 .bind(parent_id)
356 .fetch_all(&self.pool)
357 .await
358 .map_err(|e| DatabaseError::QueryError(e.to_string()))?;
359
360 Ok(rows.into_iter().map(|r| r.into_session()).collect())
361 }
362}
363
364fn status_to_string(status: &SessionStatus) -> &'static str {

Callers

nothing calls this directly

Calls 1

into_sessionMethod · 0.80

Tested by

no test coverage detected