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
9 changes: 3 additions & 6 deletions packages/db/queries/get_snapshots_with_cursor.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ WHERE
-- And NULL does not match with empty json
s.metadata @> @metadata OR @metadata = '{}'::jsonb
)
AND (
s.sandbox_started_at < @cursor_time
OR
(s.sandbox_started_at = @cursor_time AND s.sandbox_id > @cursor_id)
)
-- The order here is important, we want started_at descending, but sandbox_id ascending
AND (s.sandbox_started_at, @cursor_id::text) < (@cursor_time, s.sandbox_id)
AND NOT (s.sandbox_id = ANY (@snapshot_exclude_sbx_ids::text[]))
ORDER BY s.sandbox_started_at DESC, s.sandbox_id
ORDER BY s.sandbox_started_at DESC, s.sandbox_id ASC

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is here just make it explicit

LIMIT $1;
13 changes: 5 additions & 8 deletions packages/db/queries/get_snapshots_with_cursor.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading