Skip to content

Commit a7214f0

Browse files
authored
allow ignoring escape (#221)
1 parent 7630365 commit a7214f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

postgres.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type Dialector struct {
2424
type Config struct {
2525
DriverName string
2626
DSN string
27+
WithoutQuotingCheck bool
2728
PreferSimpleProtocol bool
2829
WithoutReturning bool
2930
Conn gorm.ConnPool
@@ -98,6 +99,11 @@ func (dialector Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement,
9899
}
99100

100101
func (dialector Dialector) QuoteTo(writer clause.Writer, str string) {
102+
if dialector.WithoutQuotingCheck {
103+
writer.WriteString(str)
104+
return
105+
}
106+
101107
var (
102108
underQuoted, selfQuoted bool
103109
continuousBacktick int8

0 commit comments

Comments
 (0)