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

Method FormatSQL

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

Source from the content-addressed store, hash-verified

186}
187
188func (a *AlterRole) FormatSQL(formatter *Formatter) {
189 formatter.WriteString("ALTER ROLE ")
190 if a.IfExists {
191 formatter.WriteString("IF EXISTS ")
192 }
193 for i, roleRenamePair := range a.RoleRenamePairs {
194 if i > 0 {
195 formatter.WriteString(", ")
196 }
197 formatter.WriteExpr(roleRenamePair)
198 }
199 if len(a.Settings) > 0 {
200 formatter.Break()
201 formatter.WriteString("SETTINGS")
202 formatter.Indent()
203 for i, setting := range a.Settings {
204 if i > 0 {
205 formatter.WriteString(",")
206 }
207 formatter.Break()
208 formatter.WriteExpr(setting)
209 }
210 formatter.Dedent()
211 }
212}
213
214func (a *AlterTable) FormatSQL(formatter *Formatter) {
215 formatter.WriteString("ALTER TABLE ")

Callers

nothing calls this directly

Calls 5

WriteStringMethod · 0.80
WriteExprMethod · 0.80
BreakMethod · 0.80
IndentMethod · 0.80
DedentMethod · 0.80

Tested by

no test coverage detected