You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
336 B
18 lines
336 B
3 years ago
|
package callbacks
|
||
|
|
||
|
import (
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
func RawExec(db *gorm.DB) {
|
||
|
if db.Error == nil && !db.DryRun {
|
||
|
result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
|
||
|
if err != nil {
|
||
|
db.AddError(err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
db.RowsAffected, _ = result.RowsAffected()
|
||
|
}
|
||
|
}
|