mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-01-23 21:19:31 -06:00
Update PaginateExecutionsParams return type to include related names
This commit is contained in:
@@ -18,7 +18,7 @@ type PaginateExecutionsParams struct {
|
||||
|
||||
func (s *Service) PaginateExecutions(
|
||||
ctx context.Context, params PaginateExecutionsParams,
|
||||
) (paginateutil.PaginateResponse, []dbgen.Execution, error) {
|
||||
) (paginateutil.PaginateResponse, []dbgen.ExecutionsServicePaginateExecutionsRow, error) {
|
||||
page := max(params.Page, 1)
|
||||
limit := min(max(params.Limit, 1), 100)
|
||||
|
||||
|
||||
@@ -24,7 +24,11 @@ AND
|
||||
);
|
||||
|
||||
-- name: ExecutionsServicePaginateExecutions :many
|
||||
SELECT executions.*
|
||||
SELECT
|
||||
executions.*,
|
||||
backups.name AS backup_name,
|
||||
databases.name AS database_name,
|
||||
destinations.name AS destination_name
|
||||
FROM executions
|
||||
JOIN backups ON backups.id = executions.backup_id
|
||||
JOIN databases ON databases.id = backups.database_id
|
||||
|
||||
Reference in New Issue
Block a user