Add Truncate
method #2220
|
@ -1241,6 +1241,7 @@ func (engine *Engine) Delete(beans ...interface{}) (int64, error) {
|
|||
}
|
||||
|
||||
// Truncate records, bean's non-empty fields are conditions
|
||||
// In contrast to Delete this method allows deletes without conditions.
|
||||
func (engine *Engine) Truncate(beans ...interface{}) (int64, error) {
|
||||
session := engine.NewSession()
|
||||
defer session.Close()
|
||||
|
|
|
@ -97,6 +97,7 @@ func (session *Session) Delete(beans ...interface{}) (int64, error) {
|
|||
}
|
||||
|
||||
// Truncate records, bean's non-empty fields are conditions
|
||||
// In contrast to Delete this method allows deletes without conditions.
|
||||
func (session *Session) Truncate(beans ...interface{}) (int64, error) {
|
||||
return session.delete(beans, false)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user