sandbox method
Database factory sandboxing.
Every database opened, deleted or checked through the returned factory
is located below path in the original factory.
If the factory is already a sandbox, the tree is sanitized (i.e. never 2 levels of sandboxing).
Works with any DatabaseFactory implementation (io, memory, web).
Implementation
DatabaseFactory sandbox({required String path}) {
var self = this;
if (self is _DatabaseFactorySandbox) {
return _DatabaseFactorySandbox(
delegate: self.delegate,
rootPath: self.delegatePath(path),
);
}
return _DatabaseFactorySandbox(delegate: this, rootPath: path);
}