mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: refactor workspaces query to use window function (#5079)
* Use window function in query * Convert workspace rows and unpack count * Update types * Fix Scan bug * Remove getCountError
This commit is contained in:
@ -10,7 +10,7 @@ LIMIT
|
||||
|
||||
-- name: GetWorkspaces :many
|
||||
SELECT
|
||||
workspaces.*
|
||||
workspaces.*, COUNT(*) OVER () as count
|
||||
FROM
|
||||
workspaces
|
||||
LEFT JOIN LATERAL (
|
||||
|
Reference in New Issue
Block a user