using Strata.SqlTools.SqlBreakdown.Classes;
namespace Strata.SqlTools.Markdown.Snowflake;
///
/// Generates Mermaid diagrams for Snowflake SQL statements, including sequence diagrams
/// for statement execution flow and entity-relationship diagrams.
///
public class SqlStatementGenerator
{
private readonly SqlServer.SqlStatementGenerator _baseGenerator;
///
/// Initializes a new instance of the SqlStatementGenerator class.
///
public SqlStatementGenerator()
{
_baseGenerator = new SqlServer.SqlStatementGenerator();
}
///
/// Generates a Mermaid sequence diagram showing Snowflake SQL statement execution flow.
///
/// The Snowflake SQL breakdown object.
/// Optional title for the diagram.
/// A string containing the Mermaid sequence diagram markdown.
public string GenerateSequenceDiagram(SqlBreakdownBase sqlBreakdown, string? title = null)
{
return _baseGenerator.GenerateSequenceDiagram(sqlBreakdown, title);
}
///
/// Generates a Mermaid entity-relationship diagram from table names.
///
/// Collection of table names to include in the diagram.
/// Optional title for the diagram.
/// A string containing the Mermaid ER diagram markdown.
public string GenerateEntityRelationshipDiagram(IEnumerable tables, string? title = null)
{
return _baseGenerator.GenerateEntityRelationshipDiagram(tables, title);
}
}