disable conds/exprs in upsert

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
Andrew Thornton 2023-03-15 17:30:37 +00:00
parent d7eb965a92
commit 67b5c85f85
No known key found for this signature in database
GPG Key ID: 3CDE74631F13A748
1 changed files with 4 additions and 0 deletions

View File

@ -160,6 +160,10 @@ func (session *Session) upsertStruct(doUpdate bool, bean interface{}) (int64, er
if len(session.statement.TableName()) == 0 {
return 0, ErrTableNotFound
}
// For the moment we're going to disable Conds for upsert as I'm not certain how best to implement those
if doUpdate && (len(session.statement.ExprColumns) > 0 || session.statement.Conds().IsValid()) {
return 0, ErrConditionType
}
// handle BeforeInsertProcessor
for _, closure := range session.beforeClosures {