MCPcopy
hub / github.com/sqlc-dev/sqlc / Format

Method Format

internal/sql/ast/do_stmt.go:13–30  ·  view source on GitHub ↗
(buf *TrackedBuffer, d format.Dialect)

Source from the content-addressed store, hash-verified

11}
12
13func (n *DoStmt) Format(buf *TrackedBuffer, d format.Dialect) {
14 if n == nil {
15 return
16 }
17 buf.WriteString("DO ")
18 // Find the "as" argument which contains the body
19 if items(n.Args) {
20 for _, arg := range n.Args.Items {
21 if de, ok := arg.(*DefElem); ok && de.Defname != nil && *de.Defname == "as" {
22 if s, ok := de.Arg.(*String); ok {
23 buf.WriteString("$$")
24 buf.WriteString(s.Str)
25 buf.WriteString("$$")
26 }
27 }
28 }
29 }
30}

Callers

nothing calls this directly

Calls 1

itemsFunction · 0.85

Tested by

no test coverage detected