disable conds/exprs in upsert
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
d7eb965a92
commit
67b5c85f85
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue