-
Notifications
You must be signed in to change notification settings - Fork 899
feat(coderd/database): support exact tags match in AcquireProvisionerJob query #12244
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,13 @@ WHERE | |
nested.started_at IS NULL | ||
-- Ensure the caller has the correct provisioner. | ||
AND nested.provisioner = ANY(@types :: provisioner_type [ ]) | ||
-- Ensure the caller satisfies all job tags. | ||
AND nested.tags <@ @tags :: jsonb | ||
-- Ensure the caller satisfies all job tags if requested, | ||
AND CASE | ||
WHEN @exact_tag_match :: boolean THEN nested.tags = @tags :: jsonb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are both guaranteed to be sorted arrays? Might be a good idea to allow unsorted equality. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think they're There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right, then a |
||
-- Otherwise, ensure caller satisfies a subset of tags. | ||
ELSE | ||
nested.tags <@ @tags :: jsonb | ||
END | ||
ORDER BY | ||
nested.created_at | ||
FOR UPDATE | ||
|
Uh oh!
There was an error while loading. Please reload this page.