diff --git a/ch/chschema/append.go b/ch/chschema/append.go index 4b31849..9781113 100644 --- a/ch/chschema/append.go +++ b/ch/chschema/append.go @@ -2,11 +2,12 @@ package chschema import ( "database/sql/driver" - "encoding/hex" "fmt" "math" "strconv" "time" + + "github.com/uptrace/go-clickhouse/ch/internal" ) func Append(fmter Formatter, b []byte, v any) []byte { @@ -116,16 +117,5 @@ func AppendBytes(b []byte, bytes []byte) []byte { if bytes == nil { return AppendNull(b) } - - b = append(b, '\'') - - tmp := make([]byte, hex.EncodedLen(len(bytes))) - hex.Encode(tmp, bytes) - - b = append(b, "\\x"...) - b = append(b, tmp...) - - b = append(b, '\'') - - return b + return AppendString(b, internal.String(bytes)) }