Skip to content

Commit

Permalink
add from as valid clause for update (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoLiberali authored Oct 8, 2023
1 parent 7ba909e commit 1eba307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package postgres
import (
"database/sql"
"fmt"
"github.com/jackc/pgx/v5"
"regexp"
"strconv"
"strings"

"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/stdlib"
"gorm.io/gorm"
"gorm.io/gorm/callbacks"
Expand Down Expand Up @@ -46,7 +46,7 @@ var timeZoneMatcher = regexp.MustCompile("(time_zone|TimeZone)=(.*?)($|&| )")
func (dialector Dialector) Initialize(db *gorm.DB) (err error) {
callbackConfig := &callbacks.Config{
CreateClauses: []string{"INSERT", "VALUES", "ON CONFLICT"},
UpdateClauses: []string{"UPDATE", "SET", "WHERE"},
UpdateClauses: []string{"UPDATE", "SET", "FROM", "WHERE"},
DeleteClauses: []string{"DELETE", "FROM", "WHERE"},
}
// register callbacks
Expand Down

0 comments on commit 1eba307

Please sign in to comment.