FruityFoundation/FruityFoundation.DataAccess.Abstractions/IDatabaseConnection.cs
2024-06-23 18:15:32 -04:00

15 lines
934 B
C#

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