feat: add last_used search params to workspaces (#9230)

* feat: add last_used search params to workspaces
This commit is contained in:
Steven Masley
2023-08-22 08:41:58 -05:00
committed by GitHub
parent e57d635739
commit 37a3b42c55
7 changed files with 107 additions and 8 deletions

View File

@ -267,6 +267,17 @@ WHERE
ELSE
locked_at IS NULL
END
-- Filter by last_used
AND CASE
WHEN @last_used_before :: timestamp with time zone > '0001-01-01 00:00:00Z' THEN
workspaces.last_used_at <= @last_used_before
ELSE true
END
AND CASE
WHEN @last_used_after :: timestamp with time zone > '0001-01-01 00:00:00Z' THEN
workspaces.last_used_at >= @last_used_after
ELSE true
END
-- Authorize Filter clause will be injected below in GetAuthorizedWorkspaces
-- @authorize_filter
ORDER BY