MCPcopy Create free account
hub / github.com/AfterShip/clickhouse-sql-parser / FormatSQL

Method FormatSQL

parser/format.go:2613–2638  ·  view source on GitHub ↗
(formatter *Formatter)

Source from the content-addressed store, hash-verified

2611}
2612
2613func (t *TableSchemaClause) FormatSQL(formatter *Formatter) {
2614 if len(t.Columns) > 0 {
2615 formatter.WriteByte('(')
2616 formatter.Indent()
2617 for i, column := range t.Columns {
2618 if i == 0 {
2619 formatter.NewLine()
2620 } else {
2621 formatter.WriteByte(',')
2622 formatter.Break()
2623 }
2624 formatter.WriteExpr(column)
2625 }
2626 formatter.Dedent()
2627 formatter.NewLine()
2628 formatter.WriteByte(')')
2629 }
2630 if t.AliasTable != nil {
2631 formatter.WriteString(" AS ")
2632 formatter.WriteExpr(t.AliasTable)
2633 }
2634 if t.TableFunction != nil {
2635 formatter.WriteString(" AS ")
2636 formatter.WriteExpr(t.TableFunction)
2637 }
2638}
2639
2640func (t *TargetPair) FormatSQL(formatter *Formatter) {
2641 formatter.WriteExpr(t.Old)

Callers

nothing calls this directly

Calls 7

WriteByteMethod · 0.80
IndentMethod · 0.80
NewLineMethod · 0.80
BreakMethod · 0.80
WriteExprMethod · 0.80
DedentMethod · 0.80
WriteStringMethod · 0.80

Tested by

no test coverage detected