Function
encodeBytesSQL
(val []byte, b BinWriter)
Source from the content-addressed store, hash-verified
| 369 | } |
| 370 | |
| 371 | func encodeBytesSQL(val []byte, b BinWriter) { |
| 372 | writebyte('\'', b) |
| 373 | for _, ch := range val { |
| 374 | if encodedChar := SQLEncodeMap[ch]; encodedChar == DontEscape { |
| 375 | writebyte(ch, b) |
| 376 | } else { |
| 377 | writebyte('\\', b) |
| 378 | writebyte(encodedChar, b) |
| 379 | } |
| 380 | } |
| 381 | writebyte('\'', b) |
| 382 | } |
| 383 | |
| 384 | func encodeBytesASCII(val []byte, b BinWriter) { |
| 385 | writebyte('\'', b) |
Tested by
no test coverage detected