You've already forked go-clickhouse
mirror of
https://github.com/uptrace/go-clickhouse.git
synced 2025-06-29 00:21:46 +02:00
chore: append bytes like a string. Fixes #43
This commit is contained in:
@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user