mirror of https://github.com/go-gorm/gorm.git
17 lines
333 B
Go
17 lines
333 B
Go
package callbacks
|
|
|
|
import (
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
func RawExec(db *gorm.DB) {
|
|
if db.Error == nil {
|
|
result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
|
|
if err != nil {
|
|
db.AddError(err)
|
|
} else {
|
|
db.RowsAffected, _ = result.RowsAffected()
|
|
}
|
|
}
|
|
}
|