newSqliteBackgroundVaultStore function
Creates a file based SqliteVaultStore on a background isolate
file
: The path to the database filecodec
: TheStoreCodec
used to convert to/from a Map<String, dynamic>` representation to a binary representationlogStatements
: IflogStatements
is true (defaults tofalse
), generated sql statements will be printed before executingdatabaseSetup
: This optional function can be used to perform a setup just after the database is opened, before drift is fully readycachePreparedStatements
: controls whether drift will cache prepared statement objectsisolateSetup
: function that can perform setup work on the isolate before opening the database.
Implementation
Future<SqliteVaultStore> newSqliteBackgroundVaultStore(
{File? file,
StoreCodec? codec,
bool? logStatements,
DatabaseSetup? databaseSetup,
bool? cachePreparedStatements,
FutureOr<void> Function()? isolateSetup}) {
return SqliteBackgroundFileAdapter.build<VaultInfo, VaultEntry>(
(QueryExecutor executor) => VaultDatabase(executor),
_defaultVaultFile(file),
logStatements: logStatements,
setup: databaseSetup,
cachePreparedStatements: cachePreparedStatements,
isolateSetup: isolateSetup)
.then((adapter) => SqliteVaultStore(adapter, codec: codec));
}