Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 102 | |
| 103 | // Format implements the NodeFormatter interface. |
| 104 | func (node *TransactionModes) Format(ctx *FmtCtx) { |
| 105 | var sep string |
| 106 | if node.Isolation != UnspecifiedIsolation { |
| 107 | ctx.Printf(" ISOLATION LEVEL %s", node.Isolation) |
| 108 | sep = "," |
| 109 | } |
| 110 | if node.UserPriority != UnspecifiedUserPriority { |
| 111 | ctx.Printf("%s PRIORITY %s", sep, node.UserPriority) |
| 112 | sep = "," |
| 113 | } |
| 114 | if node.ReadWriteMode != UnspecifiedReadWriteMode { |
| 115 | ctx.Printf("%s READ %s", sep, node.ReadWriteMode) |
| 116 | } |
| 117 | if node.AsOf.Expr != nil { |
| 118 | ctx.WriteString(sep) |
| 119 | ctx.WriteString(" ") |
| 120 | node.AsOf.Format(ctx) |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | var ( |
| 125 | errIsolationLevelSpecifiedMultipleTimes = pgerror.New(pgcode.Syntax, "isolation level specified multiple times") |