Skip to content

feat: opt-in FK cascade retain for row_filters (#88) - #90

Merged
ababic merged 2 commits into
mainfrom
cursor/row-filters-fk-cascade-5150
Aug 14, 2026
Merged

feat: opt-in FK cascade retain for row_filters (#88)#90
ababic merged 2 commits into
mainfrom
cursor/row-filters-fk-cascade-5150

Conversation

@ababic

@ababic ababic commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

Implements #88: optional parent→child retain cascading for row_filters.

[row_filters."public.listing_order"]
retain = [{ column = "status", op = "eq", value = "open" }]

[[row_filters."public.listing_order".cascade]]
child_table = "public.listing_orderitem"
child_fk = "order_id"
parent_pk = "id"

While streaming a parent table, Dumpling records parent_pk values of kept rows. Child rows are kept only when child_fk is in that set (in addition to any local retain/delete). NULL FKs are dropped.

Design notes

  • Opt-in and shallow (explicit cascade links only)—no live FK discovery or full graph topo sort (per issue non-goals).
  • Single-pass streaming: parent data must appear before child data; otherwise Dumpling fails with a clear error.
  • Retained PK sets are held in memory for the run.

Status

Rebased onto latest main (includes datetime/date predicate comparisons from #87 / #89).

Verification (post-rebase)

  • cargo test --all-targets --all-features — 182 passed
  • cargo fmt --all -- --check — clean
  • cargo clippy --all-targets --all-features -- -D warnings — clean
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 14, 2026 18:13
Add [[row_filters."<parent>".cascade]] so child rows are kept only when
their FK matches a retained parent PK. Parent data must appear before
children (streaming single-pass). Includes validation, tests, and docs.

Co-authored-by: andy <andy@wearecrew.com>
Co-authored-by: andy <andy@wearecrew.com>
@cursor
cursor Bot force-pushed the cursor/row-filters-fk-cascade-5150 branch from 4368904 to 6b684e7 Compare August 14, 2026 18:13
@ababic
ababic marked this pull request as ready for review August 14, 2026 18:17
@ababic
ababic merged commit 51f8509 into main Aug 14, 2026
10 checks passed
@ababic
ababic deleted the cursor/row-filters-fk-cascade-5150 branch August 14, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants