Parameters of type gdb.Raw do not require special treatment

This commit is contained in:
lindan.he
2021-10-15 17:45:30 +08:00
parent b826ed6b03
commit f901f19714

View File

@ -10,25 +10,23 @@ import (
"bytes"
"database/sql"
"fmt"
"github.com/gogf/gf/errors/gcode"
"reflect"
"regexp"
"strings"
"time"
"github.com/gogf/gf/errors/gcode"
"github.com/gogf/gf/errors/gerror"
"github.com/gogf/gf/internal/empty"
"github.com/gogf/gf/internal/json"
"github.com/gogf/gf/internal/structs"
"github.com/gogf/gf/internal/utils"
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/util/gmeta"
"github.com/gogf/gf/util/gutil"
"github.com/gogf/gf/internal/structs"
"github.com/gogf/gf/text/gregex"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gmeta"
"github.com/gogf/gf/util/gutil"
)
// iString is the type assert api for String.
@ -800,6 +798,10 @@ func FormatSqlWithArgs(sql string, args []interface{}) string {
if args[index] == nil {
return "null"
}
// Parameters of type Raw do not require special treatment
if v, ok := args[index].(Raw); ok {
return gconv.String(v)
}
var (
rv = reflect.ValueOf(args[index])
kind = rv.Kind()