Skip to content

Commit 1eba307

Browse files
add from as valid clause for update (#213)
1 parent 7ba909e commit 1eba307

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

postgres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package postgres
33
import (
44
"database/sql"
55
"fmt"
6-
"github.com/jackc/pgx/v5"
76
"regexp"
87
"strconv"
98
"strings"
109

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

0 commit comments

Comments
 (0)