MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Escape

Function Escape

IceFireDB-SQLite/pkg/mysql/mysql/util.go:351–363  ·  view source on GitHub ↗

Escape: only support utf-8

(sql string)

Source from the content-addressed store, hash-verified

349
350// Escape: only support utf-8
351func Escape(sql string) string {
352 dest := make([]byte, 0, 2*len(sql))
353
354 for _, w := range hack.Slice(sql) {
355 if c := EncodeMap[w]; c == DONTESCAPE {
356 dest = append(dest, w)
357 } else {
358 dest = append(dest, '\\', c)
359 }
360 }
361
362 return string(dest)
363}
364
365func GetNetProto(addr string) string {
366 if strings.Contains(addr, "/") {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected