fix: Adjust pagination limit to be zero-based (#2663)

There isn't a use-case for querying a limit of zero. Using
-1 led to issues when using default parameters for querying.
This commit is contained in:
Kyle Carberry
2022-06-26 20:23:25 +00:00
committed by GitHub
parent 95e854d144
commit 01c31b47a3
7 changed files with 14 additions and 16 deletions
+2 -2
View File
@@ -126,8 +126,8 @@ ORDER BY
-- a timestamp. This is to ensure consistent pagination.
(created_at, id) ASC OFFSET @offset_opt
LIMIT
-- A null limit means "no limit", so -1 means return all
NULLIF(@limit_opt :: int, -1);
-- A null limit means "no limit", so 0 means return all
NULLIF(@limit_opt :: int, 0);
-- name: UpdateUserStatus :one
UPDATE