bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645)

This commit is contained in:
kim 2025-01-14 14:23:28 +00:00 committed by GitHub
commit b8ef9fc4bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
89 changed files with 907 additions and 4123 deletions

View file

@ -16,6 +16,7 @@ import (
"github.com/uptrace/bun"
"github.com/uptrace/bun/dialect"
"github.com/uptrace/bun/internal"
"github.com/uptrace/bun/schema"
"github.com/uptrace/opentelemetry-go-extra/otelsql"
)
@ -169,7 +170,7 @@ func (h *QueryHook) eventQuery(event *bun.QueryEvent) string {
func unformattedQuery(event *bun.QueryEvent) string {
if event.IQuery != nil {
if b, err := event.IQuery.AppendQuery(schema.NewNopFormatter(), nil); err == nil {
return bytesToString(b)
return internal.String(b)
}
}
return string(event.QueryTemplate)

View file

@ -1,11 +0,0 @@
// +build appengine
package internal
func bytesToString(b []byte) string {
return string(b)
}
func stringToBytes(s string) []byte {
return []byte(s)
}

View file

@ -1,20 +0,0 @@
//go:build !appengine
// +build !appengine
package bunotel
import "unsafe"
func bytesToString(b []byte) string {
if len(b) == 0 {
return ""
}
return unsafe.String(&b[0], len(b))
}
func stringToBytes(s string) []byte {
if s == "" {
return []byte{}
}
return unsafe.Slice(unsafe.StringData(s), len(s))
}