upstep bun to v1.0.14 (#291)

This commit is contained in:
tobi 2021-10-24 13:14:37 +02:00 committed by GitHub
commit 8b7c3507fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 5071 additions and 3836 deletions

View file

@ -1,5 +1,11 @@
package schema
import (
"strings"
"github.com/uptrace/bun/internal"
)
type QueryAppender interface {
AppendQuery(fmter Formatter, b []byte) ([]byte, error)
}
@ -42,8 +48,13 @@ var _ QueryAppender = QueryWithArgs{}
func SafeQuery(query string, args []interface{}) QueryWithArgs {
if args == nil {
args = make([]interface{}, 0)
} else if len(query) > 0 && strings.IndexByte(query, '?') == -1 {
internal.Warn.Printf("query %q has args %v, but no placeholders", query, args)
}
return QueryWithArgs{
Query: query,
Args: args,
}
return QueryWithArgs{Query: query, Args: args}
}
func UnsafeIdent(ident string) QueryWithArgs {