Add tag filtering to JobListParams - #1339
Open
bgentry wants to merge 2 commits into
Open
Conversation
bgentry
force-pushed
the
bg/job-list-tags
branch
from
August 1, 2026 23:55
b5cbf6d to
3e51215
Compare
bgentry
added a commit
to golanglemonade/riverui
that referenced
this pull request
Aug 2, 2026
The job-list endpoint currently implements tag matching with PostgreSQL-only SQL through `JobListParams.Where`, preventing the handler from working with other River drivers. Pin River to the commit from riverqueue/river#1339 and call the new `JobListParams.Tags` method. River now owns the case-insensitive, match-any query semantics for PostgreSQL and SQLite, while RiverUI remains independent of driver-specific SQL.
bgentry
marked this pull request as ready for review
August 2, 2026 00:02
bgentry
commented
Aug 2, 2026
| } | ||
|
|
||
| jobs, err := exec.JobDeleteMany(ctx, (*riverdriver.JobDeleteManyParams)(listParams)) | ||
| jobs, err := exec.JobDeleteMany(ctx, &riverdriver.JobDeleteManyParams{ |
Contributor
Author
There was a problem hiding this comment.
ah this needs to be kept aligned with list params, will fix
Applications that need to find jobs by tag currently have to use a driver-specific `Where` predicate. That prevents shared consumers from supporting PostgreSQL and SQLite with the same list query. Add `JobListParams.Tags` with case-insensitive, match-any semantics and carry it through each driver. PostgreSQL compares unnested arrays, while SQLite compares the equivalent JSON array values. Keep the list and delete-many driver parameter layouts synchronized so the existing pointer conversion remains valid. Add shared driver coverage for combined filters, transactions, and tag matching across every supported driver.
bgentry
force-pushed
the
bg/job-list-tags
branch
from
August 2, 2026 00:10
3e51215 to
7ef57fe
Compare
bgentry
added a commit
to golanglemonade/riverui
that referenced
this pull request
Aug 2, 2026
The job-list endpoint currently implements tag matching with PostgreSQL-only SQL through `JobListParams.Where`, preventing the handler from working with other River drivers. Pin River to the commit from riverqueue/river#1339 and call the new `JobListParams.Tags` method. River now owns the case-insensitive, match-any query semantics for PostgreSQL and SQLite, while RiverUI remains independent of driver-specific SQL.
bgentry
commented
Aug 2, 2026
| } | ||
|
|
||
| // Tags returns an updated filter set that will only return jobs containing at | ||
| // least one of the given tags. Tag matching is case-insensitive. |
Contributor
Author
There was a problem hiding this comment.
@brandur while this copies what the other PR does, it doesn't feel right now that I read this comment. Wondering if we need two separate methods for filtering by all of vs any of the tags in the list?
Contributor
There was a problem hiding this comment.
Looks like you put in the two separate functions and this comment is outdated. Looks okay as is.
The tag list filter exposes match-any behavior through an ambiguous method name and folds case even though River preserves tag spelling. Its static SQL also adds work to every list query and prevents PostgreSQL from using native array operators. Replace it with exact TagsAny and TagsAll filters. Build their predicates only when requested through driver-specific fragments, using PostgreSQL overlap and containment operators and equivalent SQLite JSON predicates. Define delete parameters from list parameters so their pointer conversion stays structurally safe. Expand shared driver coverage for any, all, combined, case-sensitive, empty, pagination, transaction, and low-level fragment behavior.
brandur
approved these changes
Aug 2, 2026
brandur
left a comment
Contributor
There was a problem hiding this comment.
Nice one! Looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds exact tag filtering to job lists through explicit
JobListParams.TagsAnyand
JobListParams.TagsAllmethods. The two filters can be combined, withmatch-any and match-all groups joined to each other and other filters using
AND.
Tag predicates are added only when requested through driver-specific SQL
fragments. PostgreSQL uses native array overlap and containment operators,
while SQLite uses equivalent JSON predicates.
JobDeleteManyParamsis definedfrom the list parameter type so their existing pointer conversion remains
structurally safe.
This is the core dependency for
riverqueue/riverui#548.