Пример #1
0
        public string Execute(string sql)
        {
            var outSql     = new StringBuilder((int)(sql.Length * 1.5));
            var statements = ParserFactory.Execute(sql);

            var indentation = new Indentation();

            foreach (var statement in statements)
            {
                var formatter = StatementFormatterFactory.GetFormatter(indentation, outSql, statement);
                formatter.Execute();

                if (statement != statements.Last())
                {
                    outSql.AppendLine("\n");
                }
            }
            return(outSql.ToString());
        }
Пример #2
0
        protected void FormatStatement(IStatement statement)
        {
            var formatter = StatementFormatterFactory.GetFormatter(this, _sql, statement);

            formatter.Execute();
        }