MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Format

Method Format

pkg/sql/sem/tree/role_spec.go:62–75  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

60
61// Format implements the NodeFormatter interface.
62func (r *RoleSpec) Format(ctx *FmtCtx) {
63 f := ctx.flags
64 if f.HasFlags(FmtAnonymize) && !isArityIndicatorString(r.Name) {
65 ctx.WriteByte('_')
66 } else {
67 switch r.RoleSpecType {
68 case RoleName:
69 lexbase.EncodeRestrictedSQLIdent(&ctx.Buffer, r.Name, f.EncodeFlags())
70 return
71 case CurrentUser, SessionUser:
72 ctx.WriteString(r.RoleSpecType.String())
73 }
74 }
75}
76
77// Format implements the NodeFormatter interface.
78func (l *RoleSpecList) Format(ctx *FmtCtx) {

Callers

nothing calls this directly

Calls 5

EncodeRestrictedSQLIdentFunction · 0.92
isArityIndicatorStringFunction · 0.85
EncodeFlagsMethod · 0.80
StringMethod · 0.65
HasFlagsMethod · 0.45

Tested by

no test coverage detected