mirror of
https://github.com/coder/coder.git
synced 2026-06-07 06:58:17 +00:00
feat: sort users by username (#7838)
This commit is contained in:
@@ -143,11 +143,11 @@ WHERE
|
||||
-- duplicating or missing data.
|
||||
WHEN @after_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN (
|
||||
-- The pagination cursor is the last ID of the previous page.
|
||||
-- The query is ordered by the created_at field, so select all
|
||||
-- The query is ordered by the username field, so select all
|
||||
-- rows after the cursor.
|
||||
(created_at, id) > (
|
||||
(username) > (
|
||||
SELECT
|
||||
created_at, id
|
||||
username
|
||||
FROM
|
||||
users
|
||||
WHERE
|
||||
@@ -183,9 +183,8 @@ WHERE
|
||||
END
|
||||
-- End of filters
|
||||
ORDER BY
|
||||
-- Deterministic and consistent ordering of all users, even if they share
|
||||
-- a timestamp. This is to ensure consistent pagination.
|
||||
(created_at, id) ASC OFFSET @offset_opt
|
||||
-- Deterministic and consistent ordering of all users. This is to ensure consistent pagination.
|
||||
username ASC OFFSET @offset_opt
|
||||
LIMIT
|
||||
-- A null limit means "no limit", so 0 means return all
|
||||
NULLIF(@limit_opt :: int, 0);
|
||||
|
||||
Reference in New Issue
Block a user