This commit is contained in:
John Guo
2025-12-08 14:56:21 +08:00
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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",