Avoid unnecessary double wrapping of SELECT statement when used as single function parameter.

This commit is contained in:
go-jet 2021-10-21 13:35:37 +02:00
parent 22b2901336
commit d197956271
16 changed files with 97 additions and 77 deletions

View file

@ -195,10 +195,19 @@ func (s *statementImpl) serialize(statement StatementType, out *SQLBuilder, opti
out.IncreaseIdent()
}
if contains(options, Ident) {
out.IncreaseIdent()
}
for _, clause := range s.Clauses {
clause.Serialize(statement, out, FallTrough(options)...)
}
if contains(options, Ident) {
out.DecreaseIdent()
out.NewLine()
}
if !contains(options, NoWrap) {
out.DecreaseIdent()
out.NewLine()