chore: add sql filter to fetching audit logs (#14070)

* chore: add sql filter to fetching audit logs
* use sqlc.embed for audit logs
* fix sql query matcher
This commit is contained in:
Steven Masley
2024-08-01 12:07:19 -05:00
committed by GitHub
parent d23670ad53
commit a27ac30e11
16 changed files with 562 additions and 245 deletions

View File

@ -2,7 +2,7 @@
-- ID.
-- name: GetAuditLogsOffset :many
SELECT
audit_logs.*,
sqlc.embed(audit_logs),
-- sqlc.embed(users) would be nice but it does not seem to play well with
-- left joins.
users.username AS user_username,
@ -117,6 +117,9 @@ WHERE
workspace_builds.reason::text = @build_reason
ELSE true
END
-- Authorize Filter clause will be injected below in GetAuthorizedAuditLogsOffset
-- @authorize_filter
ORDER BY
"time" DESC
LIMIT