MCPcopy
hub / github.com/go-gorm/gorm / RawExec

Function RawExec

callbacks/raw.go:7–22  ·  view source on GitHub ↗
(db *gorm.DB)

Source from the content-addressed store, hash-verified

5)
6
7func RawExec(db *gorm.DB) {
8 if db.Error == nil && !db.DryRun {
9 result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
10 if err != nil {
11 db.AddError(err)
12 return
13 }
14
15 db.RowsAffected, _ = result.RowsAffected()
16
17 if db.Statement.Result != nil {
18 db.Statement.Result.Result = result
19 db.Statement.Result.RowsAffected = db.RowsAffected
20 }
21 }
22}

Callers

nothing calls this directly

Calls 3

ExecContextMethod · 0.65
AddErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected