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

Method Format

internal/sql/ast/column_ref.go:21–38  ·  view source on GitHub ↗
(buf *TrackedBuffer, d format.Dialect)

Source from the content-addressed store, hash-verified

19}
20
21func (n *ColumnRef) Format(buf *TrackedBuffer, d format.Dialect) {
22 if n == nil {
23 return
24 }
25
26 if n.Fields != nil {
27 var items []string
28 for _, item := range n.Fields.Items {
29 switch nn := item.(type) {
30 case *String:
31 items = append(items, d.QuoteIdent(nn.Str))
32 case *A_Star:
33 items = append(items, "*")
34 }
35 }
36 buf.WriteString(strings.Join(items, "."))
37 }
38}

Callers

nothing calls this directly

Calls 2

QuoteIdentMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected