Expand description
Cascade save: drain children from principal HasMany navigations, FK fixup after principal PK backfill, and M2M join-row insertion via direct SQL.
See cascade-save-plan.md for the full design. Key types:
DrainedChild: a child entity extracted from a principal’s HasMany, with parent linkage metadata.FixupLink: records the parent→child association for post-INSERT FK fixup (one-to-many) or join-row insertion (M2M).
Structs§
- Cascade
Delete Directive - A directive to delete or nullify untracked dependents of a Deleted principal. Generated during the cascade delete drain loop and executed as direct SQL at the start of the DELETE phase, before PK-based deletes.
- Drained
Child - A child entity drained from a principal’s HasMany navigation, with the metadata needed to fixup its FK after the principal’s PK is backfilled.
- Fixup
Link - Records a parent→child association for post-INSERT FK fixup.
Enums§
- Cascade
Delete Action - The action to take for untracked dependents when a principal is deleted.
Functions§
- m2m_
insert_ sql - Generates a batched
INSERT INTO through_table (parent_col, child_col) VALUES (?, ?), (?, ?), ...statement for M2M join rows.