BackupManager class
Export and import utilities for backing up and restoring a JustDatabase. All methods are static helpers that operate on the raw table map.
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
-
backupToFile(
Map< String, Table> tables, String filePath) → Future<void> -
Writes a SQL dump to
filePath. -
backupToJsonFile(
Map< String, Table> tables, String filePath) → Future<void> -
Writes a JSON backup to
filePath. -
exportJson(
Map< String, Table> tables) → Map<String, dynamic> - Exports all tables as a JSON-serialisable map.
-
exportSql(
Map< String, Table> tables) → String - Exports all tables as a SQL dump string (CREATE TABLE + INSERT statements).
-
importJson(
Map< String, dynamic> json, Map<String, Table> tables, {bool ignoreErrors = false}) → int - Imports tables from a JSON backup map into the given table store.
-
importSql(
String sql, Map< String, Table> tables, {bool ignoreErrors = false}) → Future<int> - Imports from a SQL dump string. Executes each statement against the provided mutable table map using the full parser+executor pipeline. Returns the number of statements executed, and throws on parse/exec errors.
-
restoreFromFile(
String filePath, Map< String, Table> tables, {bool ignoreErrors = false}) → Future<int> -
Restores from a SQL dump file at
filePath. -
restoreFromJsonFile(
String filePath, Map< String, Table> tables, {bool ignoreErrors = false}) → Future<int> -
Restores from a JSON backup file at
filePath.