HiveMigrationHelper class
Migration helper for transitioning from Hive/hive_ce to Rift. Reads old Hive data files and converts them to Rift format automatically.
Hive stores data as binary files with a specific format. This helper reads those files and converts the data into Rift boxes, preserving all key-value pairs.
Usage:
final report = await HiveMigrationHelper.migrateAll(rift: Rift);
print('Migrated ${report.successfulMigrations} of ${report.totalBoxes} boxes');
// Or migrate a single box
final result = await HiveMigrationHelper.migrateBox('settings', rift: Rift);
print('Migrated ${result.entriesMigrated} entries');
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
hiveBoxExists(
String boxName, {String? path}) → bool -
Check if a Hive box exists at the given
path. -
listHiveBoxes(
{String? path}) → List< String> -
Get a list of all Hive box names at the given
path. -
migrateAll(
{required RiftInterface rift, String? hivePath, String? riftPath}) → Future< MigrationReport> - Migrate all boxes from Hive format to Rift format.
-
migrateBox(
String boxName, {required RiftInterface rift, String? hivePath, String? riftPath}) → Future< BoxMigrationResult> - Migrate a single box from Hive to Rift.