newSqliteLocalCacheStore function Null safety

Future<SqliteCacheStore> newSqliteLocalCacheStore(
  1. {File? file,
  2. StoreCodec? codec,
  3. bool? logStatements,
  4. DatabaseSetup? databaseSetup}

Creates a new SqliteCacheStore on a file

  • file: The path to the database file
  • 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


Future<SqliteCacheStore> newSqliteLocalCacheStore(
    {File? file,
    StoreCodec? codec,
    bool? logStatements,
    DatabaseSetup? databaseSetup}) {
  return<CacheInfo, CacheEntry>(
          (QueryExecutor executor) => CacheDatabase(executor),
          file ?? File('${Directory.systemTemp.path}/cache.db'),
          logStatements: logStatements,
          setup: databaseSetup)
      .then((adapter) => SqliteCacheStore(adapter, codec: codec));