dzql 0.5.25 → 0.5.26
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
|
@@ -462,6 +462,11 @@ $$ LANGUAGE plpgsql SECURITY DEFINER;`;
|
|
|
462
462
|
return `rel.${fk} = root.id`;
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
+
// Dashboard collection: filter="TRUE" means fetch ALL rows (no FK filter)
|
|
466
|
+
if (filter === 'TRUE') {
|
|
467
|
+
return 'TRUE';
|
|
468
|
+
}
|
|
469
|
+
|
|
465
470
|
// Parse filter expression like "venue_id=$venue_id"
|
|
466
471
|
// Replace $param with v_param variable
|
|
467
472
|
return filter.replace(/\$(\w+)/g, 'v_$1');
|
|
@@ -529,10 +534,19 @@ $$ LANGUAGE plpgsql IMMUTABLE;`;
|
|
|
529
534
|
? relConfig.foreignKey
|
|
530
535
|
: `${this.rootEntity}_id`;
|
|
531
536
|
const relVia = typeof relConfig === 'object' ? relConfig.via : null;
|
|
537
|
+
const relFilter = typeof relConfig === 'object' ? relConfig.filter : null;
|
|
532
538
|
|
|
533
539
|
const params = Object.keys(this.paramSchema);
|
|
534
540
|
const firstParam = params[0] || 'id';
|
|
535
541
|
|
|
542
|
+
// Dashboard collection: filter="TRUE" means notify ALL subscribers
|
|
543
|
+
// This relation is independent from the root entity
|
|
544
|
+
if (relFilter === 'TRUE') {
|
|
545
|
+
return `-- Dashboard collection (${relEntity}) - notify all subscribers
|
|
546
|
+
WHEN '${relEntity}' THEN
|
|
547
|
+
v_affected := ARRAY['{}'::jsonb];`;
|
|
548
|
+
}
|
|
549
|
+
|
|
536
550
|
// Check if this is a nested relation (has parent FK)
|
|
537
551
|
const nestedIncludes = typeof relConfig === 'object' ? relConfig.include : null;
|
|
538
552
|
|