Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 60 | |
| 61 | // Format implements the NodeFormatter interface. |
| 62 | func (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. |
| 78 | func (l *RoleSpecList) Format(ctx *FmtCtx) { |
nothing calls this directly
no test coverage detected