Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2542dcd

Browse files
committed
add comment
1 parent8b1bc7f commit2542dcd

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

‎coderd/database/querier.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries.sql.go

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/organizationmembers.sql

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
-- name: OrganizationMembers :many
2+
-- Arguments are optional with uuid.Nil to ignore.
3+
-- - Use just 'organization_id' to get all members of an org
4+
-- - Use just 'user_id' to get all orgs a user is a member of
5+
-- - Use both to get a specific org member row
26
SELECT
37
sqlc.embed(organization_members),
48
users.username
@@ -7,18 +11,17 @@ FROM
711
INNER JOIN
812
usersONorganization_members.user_id=users.id
913
WHERE
10-
true
11-
-- Filter by organization id
12-
AND CASE
13-
WHEN @organization_id :: uuid!='00000000-0000-0000-0000-000000000000'::uuid THEN
14-
organization_id= @organization_id
15-
ELSE true
14+
-- Filter by organization id
15+
CASE
16+
WHEN @organization_id :: uuid!='00000000-0000-0000-0000-000000000000'::uuid THEN
17+
organization_id= @organization_id
18+
ELSE true
1619
END
17-
-- Filter by user id
18-
AND CASE
19-
WHEN @user_id :: uuid!='00000000-0000-0000-0000-000000000000'::uuid THEN
20-
user_id= @user_id
21-
ELSE true
20+
-- Filter by user id
21+
AND CASE
22+
WHEN @user_id :: uuid!='00000000-0000-0000-0000-000000000000'::uuid THEN
23+
user_id= @user_id
24+
ELSE true
2225
END;
2326

2427
-- name: InsertOrganizationMember :one

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp