using System.Data.Common; using FruityFoundation.Base.Structures; namespace FruityFoundation.DataAccess.Abstractions; // ReSharper disable once UnusedTypeParameter public interface IDatabaseConnection where TConnectionType : ConnectionType { public Task> Query(string sql, object? param = null, CancellationToken cancellationToken = default); public IAsyncEnumerable QueryUnbuffered(string sql, object? param = null, CancellationToken cancellationToken = default); public Task QuerySingle(string sql, object? param = null, CancellationToken cancellationToken = default); public Task> TryQueryFirst(string sql, object? param = null, CancellationToken cancellationToken = default); public Task Execute(string sql, object? param = null, CancellationToken cancellationToken = default); public Task ExecuteScalar(string sql, object? param = null, CancellationToken cancellationToken = default); public Task ExecuteReader(string sql, object? param = null, CancellationToken cancellationToken = default); }