Navigate to snapshots from the transcript

This commit is contained in:
Ian Gulliver
2026-10-15 00:08:32 -07:00
parent 75c76eff0a
commit c778741a4a
23 changed files with 763 additions and 202 deletions
+8
View File
@@ -46,6 +46,14 @@ func (s *Store) ListSnapshots(ctx context.Context, taskID string) ([]api.Snapsho
return snaps, rows.Err()
}
func (s *Store) GetSnapshot(ctx context.Context, taskID string, n int) (api.Snapshot, error) {
snap, err := scanSnapshot(s.db.QueryRowContext(ctx, `SELECT `+snapshotColumns+` FROM snapshots WHERE task_id = ? AND n = ?`, taskID, n))
if errors.Is(err, sql.ErrNoRows) {
return snap, ErrNotFound
}
return snap, err
}
func (s *Store) LastSnapshot(ctx context.Context, taskID string) (api.Snapshot, error) {
snap, err := scanSnapshot(s.db.QueryRowContext(ctx, `SELECT `+snapshotColumns+` FROM snapshots WHERE task_id = ? ORDER BY n DESC LIMIT 1`, taskID))
if errors.Is(err, sql.ErrNoRows) {