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

Function RowQuery

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

Source from the content-addressed store, hash-verified

5)
6
7func RowQuery(db *gorm.DB) {
8 if db.Error == nil {
9 BuildQuerySQL(db)
10 if db.DryRun || db.Error != nil {
11 return
12 }
13
14 if isRows, ok := db.Get("rows"); ok && isRows.(bool) {
15 db.Statement.Settings.Delete("rows")
16 db.Statement.Dest, db.Error = db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
17 } else {
18 db.Statement.Dest = db.Statement.ConnPool.QueryRowContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
19 }
20
21 db.RowsAffected = -1
22 }
23}

Callers

nothing calls this directly

Calls 6

BuildQuerySQLFunction · 0.85
GetMethod · 0.65
DeleteMethod · 0.65
QueryContextMethod · 0.65
QueryRowContextMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected