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)
| 351 | // recommend the use of Where using a condition with a comparison on the `->>` |
| 352 | // operator instead. |
| 353 | func (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. |