MCPcopy Create free account
hub / github.com/riverqueue/river / Metadata

Method Metadata

job_list_params.go:353–361  ·  view source on GitHub ↗

Metadata returns an updated filter set that will return only jobs that has metadata which contains the given JSON fragment at its top level. This is equivalent to the `@>` operator in Postgres: https://www.postgresql.org/docs/current/functions-json.html This function isn't supported in SQLite due

(json string)

Source from the content-addressed store, hash-verified

351// recommend the use of Where using a condition with a comparison on the `->>`
352// operator instead.
353func (p *JobListParams) Metadata(json string) *JobListParams {
354 paramsCopy := p.copy()
355 paramsCopy.metadataCalled = true
356 paramsCopy.where = append(paramsCopy.where, dblist.WherePredicate{
357 NamedArgs: map[string]any{"metadata_fragment": json},
358 SQL: `metadata @> @metadata_fragment::jsonb`,
359 })
360 return paramsCopy
361}
362
363// OrderBy returns an updated filter set that will sort the results using the
364// specified field and direction.

Callers 2

Test_Client_JobListFunction · 0.80
ExerciseClientFunction · 0.80

Calls 1

copyMethod · 0.95

Tested by 2

Test_Client_JobListFunction · 0.64
ExerciseClientFunction · 0.64