Skip to content

Commit 4d1628e

Browse files
committed
Fixes #94: pgx doesn't support LastInsertId
1 parent c0868b7 commit 4d1628e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model_query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (q *ModelQuery) Insert(attrs ...string) error {
105105
}
106106

107107
func insertAndReturnPK(db *DB, query *Query, pkName string) (int64, error) {
108-
if db.DriverName() != "postgres" {
108+
if db.DriverName() != "postgres" && db.DriverName() != "pgx" {
109109
result, err := query.Execute()
110110
if err != nil {
111111
return 0, err

0 commit comments

Comments
 (0)