Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@

func SQLPrintf(sqlstr string, variables []interface{}) string {
for _, v := range variables {
switch v.(type) {
switch vv := v.(type) {
case bool, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64:
sqlstr = strings.Replace(sqlstr, "?", fmt.Sprintf("%v", v), 1)
case string, time.Time:
case string:
sqlstr = strings.Replace(sqlstr, "?", fmt.Sprintf("'%s'", v), 1)
case time.Time:
sqlstr = strings.Replace(sqlstr, "?", fmt.Sprintf("'%s'", vv.UTC().Format(time.DateTime)), 1)

Check failure on line 50 in debug.go

View workflow job for this annotation

GitHub Actions / build_and_test

undefined: time.DateTime
default:
sqlstr = strings.Replace(sqlstr, "?", fmt.Sprintf("'%v'", v), 1)
}
Expand Down
Loading