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

            return(new(SQLitePersistentStorage.TryCreate(
                           _connectionPoolService,
                           workingFolderPath,
                           solutionKey.FilePath,
                           databaseFilePath,
                           _faultInjector)));
        }
コード例 #2
0
        protected override IChecksummedPersistentStorage?TryOpenDatabase(
            SolutionKey solutionKey, Solution?bulkLoadSnapshot, string workingFolderPath, string databaseFilePath)
        {
            if (!TryInitializeLibraries())
            {
                // SQLite is not supported on the current platform
                return(null);
            }

            return(SQLitePersistentStorage.TryCreate(
                       _connectionPoolService,
                       bulkLoadSnapshot,
                       workingFolderPath,
                       solutionKey.FilePath,
                       databaseFilePath,
                       _faultInjector));
        }
コード例 #3
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(Configuration.ThrowOnFailure)));
            }

            return(new(SQLitePersistentStorage.TryCreate(
                           _connectionPoolService,
                           workingFolderPath,
                           solutionKey.FilePath,
                           databaseFilePath,
                           _asyncListener,
                           _faultInjector)));
        }