BackupManager class

Backup and restore for Rift databases.

Supports full and incremental backups, plus JSON-based export/import for interoperability with external tools.

Usage:

// Full backup
final backup = await rift.backup();
await File('backup.riftbak').writeAsString(jsonEncode(backup));

// Restore from backup
final backup = jsonDecode(await File('backup.riftbak').readAsString());
await rift.restore(backup);

// Incremental backup (only changes since last backup)
final incremental = await rift.backupIncremental(sinceTimestamp);

Constructors

BackupManager(RiftImpl _rift)
Creates a BackupManager for the given _rift instance.

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

exportAll() Future<String>
Export all open boxes as a single JSON string.
exportBox(String boxName) Future<String>
Export a single box to a JSON string.
fullBackup() Future<Map<String, dynamic>>
Create a full backup of all open boxes.
importAll(String jsonData) Future<void>
Import all boxes from a JSON string.
importBox(String boxName, String jsonData) Future<void>
Import data into a single box from a JSON string.
incrementalBackup(int sinceTimestamp) Future<Map<String, dynamic>>
Create an incremental backup (only changes since sinceTimestamp).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restore(Map<String, dynamic> backup) Future<void>
Restore from a full backup.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited