Skip to content

Commit

Permalink
Merge branch 'main' into test-remove-role
Browse files Browse the repository at this point in the history
  • Loading branch information
dmjb authored Jul 16, 2024
2 parents 415bd6b + 96efacb commit 61d9877
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions database/query/profiles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ JOIN rule_instances AS r ON p.id = r.profile_id
WHERE r.rule_type_id = $1;

-- name: CountProfilesByEntityType :many
SELECT COUNT(p.id) AS num_profiles, ep.entity AS profile_entity
SELECT COUNT(DISTINCT(p.id)) AS num_profiles, r.entity_type AS profile_entity
FROM profiles AS p
JOIN entity_profiles AS ep ON p.id = ep.profile_id
GROUP BY ep.entity;
JOIN rule_instances AS r ON p.id = r.profile_id
GROUP BY r.entity_type;

-- name: CountProfilesByName :one
SELECT COUNT(*) AS num_named_profiles FROM profiles WHERE lower(name) = lower(sqlc.arg(name));
6 changes: 3 additions & 3 deletions internal/db/profiles.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 61d9877

Please sign in to comment.