(buf *bytes.Buffer, in string)
| 71 | } |
| 72 | |
| 73 | func pgwireFormatStringInTuple(buf *bytes.Buffer, in string) { |
| 74 | quote := pgwireQuoteStringInTuple(in) |
| 75 | if quote { |
| 76 | buf.WriteByte('"') |
| 77 | } |
| 78 | // Loop through each unicode code point. |
| 79 | for _, r := range in { |
| 80 | if r == '"' || r == '\\' { |
| 81 | // Strings in tuples double " and \. |
| 82 | buf.WriteByte(byte(r)) |
| 83 | buf.WriteByte(byte(r)) |
| 84 | } else { |
| 85 | buf.WriteRune(r) |
| 86 | } |
| 87 | } |
| 88 | if quote { |
| 89 | buf.WriteByte('"') |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func (d *DArray) pgwireFormat(ctx *FmtCtx) { |
| 94 | // When converting an array to text in "postgres mode" there is |
no test coverage detected