This commit is contained in:
noMoon 2021-06-01 12:44:04 -04:00
parent a981e528c6
commit c80e794a6a

View File

@ -3,6 +3,7 @@ package logger
import (
"database/sql/driver"
"fmt"
"log"
"reflect"
"regexp"
"strconv"
@ -81,6 +82,7 @@ func ExplainSQL(sql string, numericPlaceholder *regexp.Regexp, escaper string, a
vars[idx] = strconv.FormatFloat(v.(float64), 'f', -1, 64)
case string:
vars[idx] = escaper + strings.Replace(v, escaper, "\\"+escaper, -1) + escaper
log.Println("hoho", vars[idx])
default:
rv := reflect.ValueOf(v)
if v == nil || !rv.IsValid() || rv.Kind() == reflect.Ptr && rv.IsNil() {