mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 06:23:01 -06:00
upstep bun to v1.0.14 (#291)
This commit is contained in:
parent
84a8a07f38
commit
8b7c3507fe
100 changed files with 5071 additions and 3836 deletions
49
vendor/github.com/uptrace/bun/dialect/append.go
generated
vendored
49
vendor/github.com/uptrace/bun/dialect/append.go
generated
vendored
|
|
@ -4,11 +4,9 @@ import (
|
|||
"encoding/hex"
|
||||
"math"
|
||||
"strconv"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/uptrace/bun/internal"
|
||||
"github.com/uptrace/bun/internal/parser"
|
||||
)
|
||||
|
||||
func AppendError(b []byte, err error) []byte {
|
||||
|
|
@ -78,55 +76,16 @@ func AppendString(b []byte, s string) []byte {
|
|||
return b
|
||||
}
|
||||
|
||||
func AppendBytes(b []byte, bytes []byte) []byte {
|
||||
if bytes == nil {
|
||||
func AppendBytes(b, bs []byte) []byte {
|
||||
if bs == nil {
|
||||
return AppendNull(b)
|
||||
}
|
||||
|
||||
b = append(b, `'\x`...)
|
||||
|
||||
s := len(b)
|
||||
b = append(b, make([]byte, hex.EncodedLen(len(bytes)))...)
|
||||
hex.Encode(b[s:], bytes)
|
||||
|
||||
b = append(b, '\'')
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
func AppendTime(b []byte, tm time.Time) []byte {
|
||||
b = append(b, '\'')
|
||||
b = tm.UTC().AppendFormat(b, "2006-01-02 15:04:05.999999-07:00")
|
||||
b = append(b, '\'')
|
||||
return b
|
||||
}
|
||||
|
||||
func AppendJSON(b, jsonb []byte) []byte {
|
||||
b = append(b, '\'')
|
||||
|
||||
p := parser.New(jsonb)
|
||||
for p.Valid() {
|
||||
c := p.Read()
|
||||
switch c {
|
||||
case '"':
|
||||
b = append(b, '"')
|
||||
case '\'':
|
||||
b = append(b, "''"...)
|
||||
case '\000':
|
||||
continue
|
||||
case '\\':
|
||||
if p.SkipBytes([]byte("u0000")) {
|
||||
b = append(b, `\\u0000`...)
|
||||
} else {
|
||||
b = append(b, '\\')
|
||||
if p.Valid() {
|
||||
b = append(b, p.Read())
|
||||
}
|
||||
}
|
||||
default:
|
||||
b = append(b, c)
|
||||
}
|
||||
}
|
||||
b = append(b, make([]byte, hex.EncodedLen(len(bs)))...)
|
||||
hex.Encode(b[s:], bs)
|
||||
|
||||
b = append(b, '\'')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue