2025-01-01 23:14:09 +00:00
using System.Data ;
2025-03-15 01:26:11 +00:00
using Elsa.Sql.Models ;
2025-01-01 23:14:09 +00:00
namespace Elsa.Sql.Client ;
public interface ISqlClient
{
/// <summary>
2025-03-01 23:05:27 +00:00
/// Asynchronously executes a Transact-SQL statement against the connection and returns the number of rows affected.
2025-01-01 23:14:09 +00:00
/// </summary>
2025-03-15 01:26:11 +00:00
/// <param name="evaluatedQuery">The evaluated query to execute.</param>
2025-01-01 23:14:09 +00:00
/// <returns>The number of rows affected.</returns>
2025-03-15 01:26:11 +00:00
public Task < int? > ExecuteCommandAsync ( EvaluatedQuery evaluatedQuery ) ;
2025-01-01 23:14:09 +00:00
/// <summary>
2025-03-01 23:05:27 +00:00
/// Asynchronously executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
2025-01-01 23:14:09 +00:00
/// </summary>
2025-03-15 01:26:11 +00:00
/// <param name="evaluatedQuery">The evaluated query to execute.</param>
2025-01-01 23:14:09 +00:00
/// <returns>The first column of the first row in the result set, or a null reference if the result set is empty. Returns a maximum of 2033 characters.</returns>
2025-03-15 01:26:11 +00:00
public Task < object? > ExecuteScalarAsync ( EvaluatedQuery evaluatedQuery ) ;
2025-01-01 23:14:09 +00:00
/// <summary>
2025-03-01 23:05:27 +00:00
/// Asynchronously executes the query, and returns a dataset of data returned by the query.
2025-01-01 23:14:09 +00:00
/// </summary>
2025-03-15 01:26:11 +00:00
/// <param name="evaluatedQuery">The evaluated query to execute.</param>
2025-03-01 23:05:27 +00:00
/// <returns>DataSet of the queried data</returns>
2025-03-15 01:26:11 +00:00
public Task < DataSet ? > ExecuteQueryAsync ( EvaluatedQuery evaluatedQuery ) ;
2025-01-01 23:14:09 +00:00
}