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

Function Format

parser/format.go:114–118  ·  view source on GitHub ↗

Format renders an expression into compact SQL.

(expr Expr)

Source from the content-addressed store, hash-verified

112
113// Format renders an expression into compact SQL.
114func Format(expr Expr) string {
115 formatter := NewFormatter()
116 formatter.WriteExpr(expr)
117 return formatter.String()
118}
119
120func (p *BinaryOperation) isLogicalOp() bool {
121 switch p.Operation {

Callers 11

TestParser_FormatFunction · 0.85
validFormatSQLFunction · 0.85
TestFind_FirstMatchFunction · 0.85
TestVisitor_IdenticalFunction · 0.85
TestVisitor_NestRewriteFunction · 0.85
FormatSQLMethod · 0.85

Calls 3

WriteExprMethod · 0.95
StringMethod · 0.95
NewFormatterFunction · 0.85

Tested by 10

TestParser_FormatFunction · 0.68
validFormatSQLFunction · 0.68
TestFind_FirstMatchFunction · 0.68
TestVisitor_IdenticalFunction · 0.68
TestVisitor_NestRewriteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…