dialect/sql/schema: expand fmt.Stringer args in WriteDriver (#3366)

This commit is contained in:
Ariel Mashraki
2023-03-04 23:05:16 +02:00
committed by GitHub
parent 3b7715b552
commit 7e2da46e09
2 changed files with 6 additions and 4 deletions

View File

@@ -222,6 +222,8 @@ func (w *WriteDriver) formatArg(v any) (string, error) {
return "{{ BINARY_VALUE }}", nil
case time.Time:
return "{{ TIME_VALUE }}", nil
case fmt.Stringer:
return "'" + strings.ReplaceAll(v.String(), "'", "''") + "'", nil
default:
return "{{ VALUE }}", nil
}