finisher_app.go Add ExecRaw Method.

it use
Do no processing and execute the original sql
This commit is contained in:
piyongcai 2022-01-22 21:57:15 +08:00
parent e5be7ba778
commit 0e25da906f

View File

@ -662,3 +662,16 @@ func (db *DB) Exec(sql string, values ...interface{}) (tx *DB) {
return tx.callbacks.Raw().Execute(tx) return tx.callbacks.Raw().Execute(tx)
} }
// ExecRaw Do no processing and execute the original sql
func (db *DB) ExecRaw(sql string, values ...interface{}) (tx *DB) {
tx = db.getInstance()
builder := strings.Builder{}
builder.WriteString(sql)
tx.Statement.SQL = builder
tx.Statement.Vars = values
return tx.callbacks.Raw().Execute(tx)
}