isar / isar/hive

Create the possibility to delete recursively all HiveList's objects when deleting it's container.

Open
#630 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

This is not a problem.

I'm frustrated when deleting a HiveObject with HiveLists. When deleting the HiveObject I need to create code to traverse all it's HiveLists to delete the content of these lists.

I would like to have a parameter like **recursive:** in Box's **delete** operation and the hive_builder could generate **delete**s in the content of all HiveObject's HiveLists recursively, for example, if the HiveList contains a HiveObject with HiveLists, those HiveLists will also be removed recursively. I know that there is a **deleteAllFromHive** and I use it a lot, but it is also not recursive and would probably be a candidate to also have its own **recursive:** parameter. And to prevent some HiveLists from being removed recursively, a **recursive:** parameter could also be added to the marker **@ HiveField** to prevent a recursive operation on this specific list when its value is false, allowing for recursive and non-recursive exclusions. on the same HiveObject.

As an alternative I always create the code for each of the HiveList in the HiveObject and, because the Dart mirror library is unstable, this makes a generalization of the delete operation of the application created HiveObject a very difficult operation.

**Version**
- Platform: iOS, Android, Mac, Windows, Linux, Web
- Flutter version: 2.0.4 • channel stable, Framework • revision b1395592de, Engine • revision 2dce47073a, Tools • Dart 2.12.2
- Hive version: hive: ^2.0.2, hive_flutter: ^1.0.0, hive_generator: ^1.0.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.