/*
* Copyright (c) 2022 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins.Extensions.Data
* File: IBulkDataStore.cs
*
* IBulkDataStore.cs is part of VNLib.Plugins.Extensions.Data which is part of the larger
* VNLib collection of libraries and utilities.
*
* VNLib.Plugins.Extensions.Data is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* VNLib.Plugins.Extensions.Data is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
using System.Collections.Generic;
using System.Threading.Tasks;
using VNLib.Utils;
namespace VNLib.Plugins.Extensions.Data.Abstractions
{
///
/// An abstraction that defines a Data-Store that supports
/// bulk data operations
///
/// The data-model type
public interface IBulkDataStore
{
///
/// Deletes a collection of records from the store
///
/// A collection of records to delete
///A task the resolves the number of entires removed from the store
Task DeleteBulkAsync(ICollection records);
///
/// Updates a collection of records
///
/// The collection of records to update
/// A task the resolves an error code (should evaluate to false on failure, and true on success)
Task UpdateBulkAsync(ICollection records);
///
/// Creates a bulk collection of records as entries in the store
///
/// The collection of records to add
/// A task the resolves an error code (should evaluate to false on failure, and true on success)
Task CreateBulkAsync(ICollection records);
///
/// Creates or updates individual records from a bulk collection of records
///
/// The collection of records to add
/// A task the resolves an error code (should evaluate to false on failure, and true on success)
Task AddOrUpdateBulkAsync(ICollection records);
}
}