Example #1
0
        protected override ValueTask <IChecksummedPersistentStorage?> TryOpenDatabaseAsync(
            SolutionKey solutionKey, string workingFolderPath, string databaseFilePath, CancellationToken cancellationToken)
        {
            if (!TryInitializeLibraries())
            {
                // SQLite is not supported on the current platform
                return(new((IChecksummedPersistentStorage?)null));
            }

            if (solutionKey.FilePath == null)
            {
                return(new(NoOpPersistentStorage.GetOrThrow(_options)));
            }

            return(new(SQLitePersistentStorage.TryCreate(
                           _connectionPoolService,
                           workingFolderPath,
                           solutionKey.FilePath,
                           databaseFilePath,
                           _faultInjector)));
        }
Example #2
0
 public IPersistentStorage GetStorage(Solution solution)
 => NoOpPersistentStorage.GetOrThrow(solution.Options);
Example #3
0
 public IPersistentStorage GetStorage(Solution solution)
 => NoOpPersistentStorage.GetOrThrow(throwOnFailure: false);