Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions internal/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,22 @@ func (r *Repository) ListRecentRuns(ctx context.Context, limit int) ([]models.Ba
return items, err
}

func (r *Repository) ListRecentRunsPage(ctx context.Context, offset, limit int) ([]models.BackupRun, error) {
if limit <= 0 {
limit = 50
}
if offset < 0 {
offset = 0
}
var items []models.BackupRun
err := r.db.WithContext(ctx).
Order("started_at desc").
Offset(offset).
Limit(limit).
Find(&items).Error
return items, err
}

func (r *Repository) ListRunsSince(ctx context.Context, since time.Time) ([]models.BackupRun, error) {
var items []models.BackupRun
err := r.db.WithContext(ctx).
Expand Down
Loading
Loading