mirror of https://github.com/go-gorm/gorm.git
Allow modify statement from dest
This commit is contained in:
parent
cfbcedbf03
commit
4d6b70ec88
|
@ -93,6 +93,10 @@ func (p *processor) Execute(db *DB) *DB {
|
||||||
resetBuildClauses = true
|
resetBuildClauses = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if optimizer, ok := db.Statement.Dest.(StatementModifier); ok {
|
||||||
|
optimizer.ModifyStatement(stmt)
|
||||||
|
}
|
||||||
|
|
||||||
// assign model values
|
// assign model values
|
||||||
if stmt.Model == nil {
|
if stmt.Model == nil {
|
||||||
stmt.Model = stmt.Dest
|
stmt.Model = stmt.Dest
|
||||||
|
|
|
@ -20,6 +20,7 @@ type Builder interface {
|
||||||
Writer
|
Writer
|
||||||
WriteQuoted(field interface{})
|
WriteQuoted(field interface{})
|
||||||
AddVar(Writer, ...interface{})
|
AddVar(Writer, ...interface{})
|
||||||
|
AddError(error) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clause
|
// Clause
|
||||||
|
|
Loading…
Reference in New Issue