MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / renderSetOperation

Function renderSetOperation

pkg/formatter/render.go:630–656  ·  view source on GitHub ↗
(s *ast.SetOperation, opts ast.FormatOptions)

Source from the content-addressed store, hash-verified

628}
629
630func renderSetOperation(s *ast.SetOperation, opts ast.FormatOptions) string {
631 if s == nil {
632 return ""
633 }
634 f := newNodeFormatter(opts)
635 sb := f.sb
636
637 if s.Left != nil {
638 sb.WriteString(FormatStatement(s.Left, opts))
639 }
640 sb.WriteString(f.clauseSep())
641 op := s.Operator
642 if s.All {
643 op += " ALL"
644 }
645 sb.WriteString(f.kw(op))
646 sb.WriteString(f.clauseSep())
647 if s.Right != nil {
648 sb.WriteString(FormatStatement(s.Right, opts))
649 }
650
651 if opts.AddSemicolon {
652 sb.WriteString(";")
653 }
654
655 return f.result()
656}
657
658func renderAlterTable(a *ast.AlterTableStatement, opts ast.FormatOptions) string { //nolint:staticcheck // AlterTableStatement kept for backward compatibility
659 if a == nil {

Callers 1

FormatStatementFunction · 0.85

Calls 5

newNodeFormatterFunction · 0.85
FormatStatementFunction · 0.85
clauseSepMethod · 0.80
kwMethod · 0.80
resultMethod · 0.80

Tested by

no test coverage detected