(buf *bytes.Buffer, in string)
| 57 | } |
| 58 | |
| 59 | func pgwireFormatStringInTuple(buf *bytes.Buffer, in string) { |
| 60 | quote := pgwireQuoteStringInTuple(in) |
| 61 | if quote { |
| 62 | buf.WriteByte('"') |
| 63 | } |
| 64 | // Loop through each unicode code point. |
| 65 | for _, r := range in { |
| 66 | if r == '"' || r == '\\' { |
| 67 | // Strings in tuples double " and \. |
| 68 | buf.WriteByte(byte(r)) |
| 69 | buf.WriteByte(byte(r)) |
| 70 | } else { |
| 71 | buf.WriteRune(r) |
| 72 | } |
| 73 | } |
| 74 | if quote { |
| 75 | buf.WriteByte('"') |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func (d *DArray) pgwireFormat(ctx *FmtCtx) { |
| 80 | // When converting an array to text in "postgres mode" there is |
no test coverage detected
searching dependent graphs…