EncodeSQLBytes encodes the SQL byte array in 'in' to buf, to a format suitable for re-scanning. We don't use a straightforward hex encoding here with x'...' because the result would be less compact. We are trading a little more time during the encoding to have a little less bytes on the wire.
(buf *bytes.Buffer, in string)
| 214 | // compact. We are trading a little more time during the encoding to |
| 215 | // have a little less bytes on the wire. |
| 216 | func EncodeSQLBytes(buf *bytes.Buffer, in string) { |
| 217 | buf.WriteString("b'") |
| 218 | EncodeSQLBytesInner(buf, in) |
| 219 | buf.WriteByte('\'') |
| 220 | } |
| 221 | |
| 222 | // EncodeSQLBytesInner is like EncodeSQLBytes but does not include the |
| 223 | // outer quote delimiter and the 'b' prefix. |
no test coverage detected
searching dependent graphs…