示例#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)));
        }
示例#2
0
 public IPersistentStorage GetStorage(Solution solution)
 => NoOpPersistentStorage.GetOrThrow(solution.Options);
示例#3
0
 public IPersistentStorage GetStorage(Solution solution)
 => NoOpPersistentStorage.GetOrThrow(throwOnFailure: false);