Skip to content

Commit 5bb0ffc

Browse files
committed
Slightly more optimized query
1 parent 161be27 commit 5bb0ffc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coderd/database/queries.sql.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/organizations.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ INSERT INTO
4242
organizations (id, "name", description, created_at, updated_at, is_default)
4343
VALUES
4444
-- If no organizations exist, and this is the first, make it the default.
45-
($1, $2, $3, $4, $5, (SELECT count(*) FROM organizations) = 0) RETURNING *;
45+
($1, $2, $3, $4, $5, (SELECT TRUE FROM organizations LIMIT 1) IS NULL) RETURNING *;

0 commit comments

Comments
 (0)