using Microsoft.Data.SqlClient;

namespace IWS5.DatabaseAccess.Interfaces;

public interface ICustomQueryRepository
{
    /// <summary>
    /// Executes a SQL query and returns a single string value.
    /// </summary>
    /// <param name="sqlQuery">The SQL query to execute.</param>
    /// <param name="parameters">Optional SQL parameters.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains the string value.</returns>
    Task<string> ExecuteScalarStringAsync(string sqlQuery, params SqlParameter[] parameters);
    
    /// <summary>
    /// Executes a SQL query and returns the first column value from the first row.
    /// </summary>
    /// <param name="sqlQuery">The SQL query to execute.</param>
    /// <param name="parameters">Optional SQL parameters.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains the string value or null.</returns>
    Task<string?> ExecuteScalarStringOrDefaultAsync(string sqlQuery, params SqlParameter[] parameters);
    
    /// <summary>
    /// Executes a SQL query and returns a list of string values from the first column.
    /// </summary>
    /// <param name="sqlQuery">The SQL query to execute.</param>
    /// <param name="parameters">Optional SQL parameters.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains a list of string values.</returns>
    Task<List<string>> ExecuteQueryStringsAsync(string sqlQuery, params SqlParameter[] parameters);
}