using Dapper;
namespace EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
///
///
///
public interface ISQLExecutor
{
///
/// Executes a raw SQL query and returns an for further querying operations on the result.
///
/// The entity type to which the SQL query results will be mapped.
/// The raw SQL query to execute.
/// Parameters for the SQL query.
/// Optional cancellation token for the operation.
/// An instance for further query operations on the result.
Task> Execute(string sql, DynamicParameters parameters, CancellationToken cancellation = default);
///
/// Executes a custom SQL query defined by a class that implements and returns an for further querying operations on the result.
///
/// The entity type to which the SQL query results will be mapped.
/// The type of the custom SQL query class implementing .
/// Parameters for the SQL query.
/// Optional cancellation token for the operation.
/// An instance for further query operations on the result.
Task> Execute(DynamicParameters parameters, CancellationToken cancellation = default) where TSQL : ISQL;
}