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

Method Format

pkg/sql/sem/plpgsqltree/exception.go:23–40  ·  view source on GitHub ↗
(ctx *tree.FmtCtx)

Source from the content-addressed store, hash-verified

21}
22
23func (s *Exception) Format(ctx *tree.FmtCtx) {
24 ctx.WriteString("WHEN ")
25 for i, cond := range s.Conditions {
26 if i > 0 {
27 ctx.WriteString(" OR ")
28 }
29 if cond.SqlErrState != "" {
30 ctx.WriteString("SQLSTATE ")
31 formatStringQuotes(ctx, cond.SqlErrState)
32 } else {
33 formatString(ctx, cond.SqlErrName)
34 }
35 }
36 ctx.WriteString(" THEN\n")
37 for _, stmt := range s.Action {
38 ctx.FormatNode(stmt)
39 }
40}
41
42func (s *Exception) PlpgSQLStatementTag() string {
43 return "proc_exception"

Callers

nothing calls this directly

Calls 3

formatStringQuotesFunction · 0.85
formatStringFunction · 0.85
FormatNodeMethod · 0.80

Tested by

no test coverage detected