mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
up
This commit is contained in:
@ -34,7 +34,7 @@ func (d *Driver) DoInsert(
|
||||
return nil, gerror.WrapCode(
|
||||
gcode.CodeInternalError,
|
||||
err,
|
||||
`failed to get primary keys for SaReplace operation`,
|
||||
`failed to get primary keys for Save/Replace operation`,
|
||||
)
|
||||
}
|
||||
foundPrimaryKey := false
|
||||
|
||||
@ -219,8 +219,8 @@ func Test_FormatUpsert_NoOnConflict(t *testing.T) {
|
||||
}).Insert()
|
||||
t.AssertNil(err)
|
||||
|
||||
// Try Save without OnConflict - should fail for pgsql
|
||||
// PostgreSQL requires OnConflict() for Save() operations, unlike MySQL
|
||||
// Try Save without OnConflict and without primary key in data - should fail
|
||||
// because driver cannot auto-detect conflict columns when primary key is missing
|
||||
_, err = db.Model(table).Data(g.Map{
|
||||
// "id": 1,
|
||||
"passport": "no_conflict_user",
|
||||
|
||||
Reference in New Issue
Block a user