Questions tab, question bubbles, answer snapshots; errors to transcript
This commit is contained in:
@@ -62,6 +62,14 @@ func (s *Store) LastSnapshot(ctx context.Context, taskID string) (api.Snapshot,
|
||||
return snap, err
|
||||
}
|
||||
|
||||
func (s *Store) LastSnapshotNot(ctx context.Context, taskID string, trigger api.SnapshotTrigger) (api.Snapshot, error) {
|
||||
snap, err := scanSnapshot(s.db.QueryRowContext(ctx, `SELECT `+snapshotColumns+` FROM snapshots WHERE task_id = ? AND trigger != ? ORDER BY n DESC LIMIT 1`, taskID, string(trigger)))
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return snap, ErrNotFound
|
||||
}
|
||||
return snap, err
|
||||
}
|
||||
|
||||
func (s *Store) LastTaskSeq(ctx context.Context, taskID string) (int64, error) {
|
||||
seq := int64(0)
|
||||
err := s.db.QueryRowContext(ctx, `SELECT COALESCE(MAX(seq), 0) FROM events WHERE task_id = ?`, taskID).Scan(&seq)
|
||||
|
||||
Reference in New Issue
Block a user