Skip to content

feat: create database tables and queries for notifications #13536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Optimize AcquireNotificationMessages to drop a join
This has the unfortunate side-effect of not allowing the AcquireNotificationMessagesRow.Payload type to be overriden to []byte as it was previously, but it does not change the semantics

Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed Jun 27, 2024
commit c1a30103fbaff1d885f1f32e1c6a6459fe286bc0
7 changes: 3 additions & 4 deletions coderd/database/queries.sql.go

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

5 changes: 2 additions & 3 deletions coderd/database/queries/notifications.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ WITH acquired AS (
FOR UPDATE OF nm
SKIP LOCKED
LIMIT sqlc.arg('count'))
RETURNING id)
RETURNING *)
SELECT
-- message
nm.id,
Expand All @@ -82,8 +82,7 @@ SELECT
-- template
nt.title_template,
nt.body_template
FROM acquired
JOIN notification_messages nm ON acquired.id = nm.id
FROM acquired nm
JOIN notification_templates nt ON nm.notification_template_id = nt.id;

-- name: BulkMarkNotificationMessagesFailed :execrows
Expand Down
Loading