(&self, id: &str)
| 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, |
nothing calls this directly
no test coverage detected