open method
Future<void>
open(})
Implementation
Future<void> open(
Schema schema, {
String dbPath = 'default.db',
bool nukeDb = false,
Future<void> Function(SqlliteDatabase db)? onBeforeMigration,
}) async {
if (initialised) return;
if (_initialisationCompleter == null) {
_initialisationCompleter = Completer();
this.schema = schema;
this.schema.tables[metaTableName] = Table(columns: [Column.integer('current_version')], name: metaTableName);
this.onBeforeMigration = onBeforeMigration;
tables = schema.tables.map((key, table) => MapEntry(key, table.toDbTable(this)));
await _open(
dbPath,
nukeDb: nukeDb,
).whenComplete(() => _initialisationCompleter!.complete());
}
await _initialisationCompleter!.future;
}