newSqliteMemoryVaultStore function

Future<SqliteVaultStore> newSqliteMemoryVaultStore({
  1. StoreCodec? codec,
  2. bool? logStatements,
  3. DatabaseSetup? databaseSetup,
})

Creates a new in-memory SqliteVaultStore

  • codec: The StoreCodec used to convert to/from a Map<String, dynamic>` representation to a binary representation
  • logStatements: If logStatements is true (defaults to false), generated sql statements will be printed before executing
  • databaseSetup: This optional function can be used to perform a setup just after the database is opened, before drift is fully ready

Implementation

Future<SqliteVaultStore> newSqliteMemoryVaultStore(
    {StoreCodec? codec, bool? logStatements, DatabaseSetup? databaseSetup}) {
  return SqliteMemoryAdapter.build<VaultInfo, VaultEntry>(
          (QueryExecutor executor) => VaultDatabase(executor),
          logStatements: logStatements,
          setup: databaseSetup)
      .then((adapter) => SqliteVaultStore(adapter, codec: codec));
}