Automatically delete related Convex documents using existing indexes with atomic or batched modes for data consistency.
npm install @00akshatsinha00/convex-cascading-deleteA Convex component for managing cascading deletes across related documents. Configure relationships via existing indexes, then delete documents safely knowing all related records will be cleaned up automatically with clear consistency guarantee
The convex-cascading-delete component automatically handles related document deletion by leveraging your existing indexes to define relationships. Configure the relationships once, then call the deletion function to remove a document and all its related records atomically.
This component uses your existing Convex indexes as relationship definitions to perform cascading deletes. You can configure parent-child relationships and choose between atomic or batched deletion modes depending on your data consistency needs.
The convex-cascading-delete component ensures referential integrity by automatically cleaning up related documents when you delete a parent record. It provides clear consistency guarantees through atomic operations or batched processing.
Yes, convex-cascading-delete leverages your existing Convex indexes to define document relationships. You don't need to create new indexes or modify your schema - the component uses the indexes you've already defined to understand how documents are related and cascade deletions accordingly.
Atomic mode ensures all related documents are deleted in a single transaction, providing strict consistency but with potential performance limitations for large relationship graphs. Batched mode processes deletions in chunks, offering better performance for large datasets while maintaining eventual consistency.
Yes, convex-cascading-delete allows you to configure specific relationships for cascading deletion rather than automatically deleting all related records. You define which index-based relationships should trigger cascades, giving you fine-grained control over the deletion behavior.
The convex-cascading-delete component includes safeguards to detect and handle circular references in your document relationships. It prevents infinite deletion loops while ensuring all appropriate related documents are still cleaned up properly.