Builds JSONB containment clause: `data @> '{"field": value}'::jsonb` (uses GIN index)
(tableName: string, field: string, value: JsonValue)
| 454 | |
| 455 | /** Builds JSONB containment clause: `data @> '{"field": value}'::jsonb` (uses GIN index) */ |
| 456 | function buildContainmentClause(tableName: string, field: string, value: JsonValue): SQL { |
| 457 | const jsonObj = JSON.stringify({ [field]: value }) |
| 458 | return sql`${sql.raw(`${tableName}.data`)} @> ${jsonObj}::jsonb` |
| 459 | } |
| 460 | |
| 461 | /** |
| 462 | * Builds a typed range comparison against a JSONB cell. |
no outgoing calls
no test coverage detected