namespace Strata.SqlTools.EFCore.Models;
///
/// Represents a SQL query breakdown entity for Entity Framework Core mapping.
/// This entity encapsulates the query components (SELECT, FROM, WHERE, etc.)
/// and is designed to be compatible with EF Core DbContext and database models.
///
public class QueryBreakdownEntity
{
///
/// Gets or sets the unique identifier for this query breakdown.
///
public int Id { get; set; }
///
/// Gets or sets the SELECT clause of the query.
///
public string? SelectClause { get; set; }
///
/// Gets or sets the comment for the SELECT clause.
///
public string? SelectClauseComment { get; set; }
///
/// Gets or sets the FROM clause of the query.
///
public string? FromClause { get; set; }
///
/// Gets or sets the comment for the FROM clause.
///
public string? FromClauseComment { get; set; }
///
/// Gets or sets the WHERE clause of the query.
///
public string? WhereClause { get; set; }
///
/// Gets or sets the comment for the WHERE clause.
///
public string? WhereClauseComment { get; set; }
///
/// Gets or sets the GROUP BY clause of the query.
///
public string? GroupByClause { get; set; }
///
/// Gets or sets the comment for the GROUP BY clause.
///
public string? GroupByClauseComment { get; set; }
///
/// Gets or sets the HAVING clause of the query.
///
public string? HavingClause { get; set; }
///
/// Gets or sets the comment for the HAVING clause.
///
public string? HavingClauseComment { get; set; }
///
/// Gets or sets the ORDER BY clause of the query.
///
public string? OrderByClause { get; set; }
///
/// Gets or sets the comment for the ORDER BY clause.
///
public string? OrderByClauseComment { get; set; }
///
/// Gets or sets the WITH clause (Common Table Expressions) as a JSON string.
///
public string? WithClause { get; set; }
///
/// Gets or sets the raw/original SQL statement before parsing and breakdown.
///
public string? RawSql { get; set; }
///
/// Gets or sets the setup clauses as a JSON string.
/// These are clauses to execute before the main statement.
///
public string? SetupClausesJson { get; set; }
///
/// Gets or sets the finish clauses as a JSON string.
/// These are clauses to execute after the main statement.
///
public string? FinishClausesJson { get; set; }
///
/// Gets or sets the parameters as a JSON string.
/// Contains parameter names and their values.
///
public string? ParametersJson { get; set; }
///
/// Gets or sets the timestamp when this entity was created.
///
public DateTime CreatedAt { get; set; }
///
/// Gets or sets the timestamp when this entity was last updated.
///
public DateTime UpdatedAt { get; set; }
///
/// Navigation property for the related query parameters.
///
public virtual ICollection Parameters { get; set; } = new List();
///
/// Navigation property for the related WITH clauses (CTEs).
///
public virtual ICollection WithClauses { get; set; } = new List();
}