build static method
Builds SembastMemoryAdapter.
name
: The name of the databaseversion
: The expected versiononVersionChanged
: Ifversion
not null and if the existing version is different, onVersionChanged is calledmode
: The database modesembastCodec
: The codec which can be used to load/save a record, allowing for user encryption
Implementation
static Future<SembastAdapter> build(String name,
{int? version,
OnVersionChangedFunction? onVersionChanged,
DatabaseMode? mode,
SembastCodec? sembastCodec}) {
return newDatabaseFactoryMemory()
.openDatabase(name,
version: version,
onVersionChanged: onVersionChanged,
mode: mode,
codec: sembastCodec)
.then((db) => SembastMemoryAdapter._(db, name));
}