Skip to content

Commit

Permalink
allow ignoring escape (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
shedyfreak authored Oct 26, 2023
1 parent 7630365 commit a7214f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Dialector struct {
type Config struct {
DriverName string
DSN string
WithoutQuotingCheck bool
PreferSimpleProtocol bool
WithoutReturning bool
Conn gorm.ConnPool
Expand Down Expand Up @@ -98,6 +99,11 @@ func (dialector Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement,
}

func (dialector Dialector) QuoteTo(writer clause.Writer, str string) {
if dialector.WithoutQuotingCheck {
writer.WriteString(str)
return
}

var (
underQuoted, selfQuoted bool
continuousBacktick int8
Expand Down

0 comments on commit a7214f0

Please sign in to comment.