Skip to content

Commit 164f8d6

Browse files
committed
sqlc.embed
1 parent e000bd1 commit 164f8d6

File tree

4 files changed

+19
-31
lines changed

4 files changed

+19
-31
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,13 +2659,7 @@ func (q *FakeQuerier) GetGroups(_ context.Context, arg database.GetGroupsParams)
26592659
}
26602660

26612661
filtered = append(filtered, database.GetGroupsRow{
2662-
ID: group.ID,
2663-
Name: group.Name,
2664-
OrganizationID: group.OrganizationID,
2665-
AvatarURL: group.AvatarURL,
2666-
QuotaAllowance: group.QuotaAllowance,
2667-
DisplayName: group.DisplayName,
2668-
Source: group.Source,
2662+
Group: group,
26692663
OrganizationDisplayName: orgDisplayName,
26702664
})
26712665
}

coderd/database/queries.sql.go

Lines changed: 9 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/groups.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LIMIT
2222

2323
-- name: GetGroups :many
2424
SELECT
25-
groups.*, organizations.display_name AS organization_display_name
25+
sqlc.embed(groups), organizations.display_name AS organization_display_name
2626
FROM
2727
groups
2828
INNER JOIN

coderd/telemetry/telemetry.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,15 +669,15 @@ func ConvertUser(dbUser database.User) User {
669669
}
670670
}
671671

672-
func ConvertGroup(group database.Group) Group {
672+
func ConvertGroup(row database.GetGroupsRow) Group {
673673
return Group{
674-
ID: group.ID,
675-
Name: group.Name,
676-
OrganizationID: group.OrganizationID,
677-
AvatarURL: group.AvatarURL,
678-
QuotaAllowance: group.QuotaAllowance,
679-
DisplayName: group.DisplayName,
680-
Source: group.Source,
674+
ID: row.Group.ID,
675+
Name: row.Group.Name,
676+
OrganizationID: row.Group.OrganizationID,
677+
AvatarURL: row.Group.AvatarURL,
678+
QuotaAllowance: row.Group.QuotaAllowance,
679+
DisplayName: row.Group.DisplayName,
680+
Source: row.Group.Source,
681681
}
682682
}
683683

0 commit comments

Comments
 (0)