rez_core 7.1.85 → 7.1.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "7.1.85",
3
+ "version": "7.1.86",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -271,18 +271,32 @@ export function buildFlatJsonSelectCondition(
271
271
  case 'equal':
272
272
  case 'contains':
273
273
  // Check if value matches - handles both string and array storage
274
- // For string: e.json_data->>'attr' = 'value'
275
- // For array: e.json_data->'attr' @> '["value"]'::jsonb
276
- return {
277
- query: `(
278
- e.${jsonColumn}->>'${attr}' = :${key}_str
279
- OR (e.${jsonColumn}->'${attr}')::jsonb @> :${key}_arr::jsonb
280
- )`,
281
- params: {
282
- [`${key}_str`]: arr[0],
283
- [`${key}_arr`]: JSON.stringify([arr[0]])
284
- },
285
- };
274
+ // For multiple values: check if stored value is IN the provided array
275
+ if (arr.length > 1) {
276
+ // Multiple values: check if stored value matches ANY of the provided values
277
+ return {
278
+ query: `(
279
+ e.${jsonColumn}->>'${attr}' IN (:...${key}_str_arr)
280
+ OR (e.${jsonColumn}->'${attr}')::jsonb ?| :${key}_jsonb_arr
281
+ )`,
282
+ params: {
283
+ [`${key}_str_arr`]: arr,
284
+ [`${key}_jsonb_arr`]: arr
285
+ },
286
+ };
287
+ } else {
288
+ // Single value: check exact match
289
+ return {
290
+ query: `(
291
+ e.${jsonColumn}->>'${attr}' = :${key}_str
292
+ OR (e.${jsonColumn}->'${attr}')::jsonb @> :${key}_arr::jsonb
293
+ )`,
294
+ params: {
295
+ [`${key}_str`]: arr[0],
296
+ [`${key}_arr`]: JSON.stringify([arr[0]])
297
+ },
298
+ };
299
+ }
286
300
  case 'not_equal':
287
301
  case 'not_contains':
288
302
  // Check if value does NOT match - handles both string and array storage