MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / get

Method get

crates/opencode-storage/src/repository.rs:195–212  ·  view source on GitHub ↗
(&self, id: &str)

Source from the content-addressed store, hash-verified

193 }
194
195 pub async fn get(&self, id: &str) -> Result<Option<Session>, DatabaseError> {
196 let row = sqlx::query_as::<_, SessionRow>(
197 r#"SELECT
198 id, project_id, parent_id, slug, directory, title, version, share_url,
199 summary_additions, summary_deletions, summary_files, summary_diffs,
200 revert, permission,
201 usage_input_tokens, usage_output_tokens, usage_reasoning_tokens,
202 usage_cache_write_tokens, usage_cache_read_tokens, usage_total_cost,
203 status, created_at, updated_at, time_compacting, time_archived
204 FROM sessions WHERE id = ?"#,
205 )
206 .bind(id)
207 .fetch_optional(&self.pool)
208 .await
209 .map_err(|e| DatabaseError::QueryError(e.to_string()))?;
210
211 Ok(row.map(|r| r.into_session()))
212 }
213
214 pub async fn list(
215 &self,

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
into_sessionMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected