newSqliteMemoryCacheStore function

Future<SqliteCacheStore> newSqliteMemoryCacheStore({
  1. StoreCodec? codec,
  2. bool? logStatements,
  3. DatabaseSetup? databaseSetup,
  4. bool? cachePreparedStatements,
})

Creates a new in-memory SqliteCacheStore

  • 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
  • cachePreparedStatements: controls whether drift will cache prepared statement objects

Implementation

Future<SqliteCacheStore> newSqliteMemoryCacheStore(
    {StoreCodec? codec,
    bool? logStatements,
    DatabaseSetup? databaseSetup,
    bool? cachePreparedStatements}) {
  return SqliteMemoryAdapter.build<CacheInfo, CacheEntry>(
          (QueryExecutor executor) => CacheDatabase(executor),
          logStatements: logStatements,
          setup: databaseSetup,
          cachePreparedStatements: cachePreparedStatements)
      .then((adapter) => SqliteCacheStore(adapter, codec: codec));
}