build static method
Builds SembastLocalAdapter.
path
: The location of the database fileversion
: 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 path,
{int? version,
OnVersionChangedFunction? onVersionChanged,
DatabaseMode? mode,
SembastCodec? sembastCodec}) {
return databaseFactoryIo
.openDatabase(path,
version: version,
onVersionChanged: onVersionChanged,
mode: mode,
codec: sembastCodec)
.then((db) => SembastLocalAdapter._(db, path));
}