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

Method apply

generics.go:173–183  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

171}
172
173func (g *g[T]) apply(ctx context.Context) *DB {
174 db := g.db
175 if !db.DryRun {
176 db = db.Session(&Session{NewDB: true, Context: ctx}).getInstance()
177 }
178
179 for _, op := range g.ops {
180 db = op(db)
181 }
182 return db
183}
184
185func (c *g[T]) Raw(sql string, values ...interface{}) ExecInterface[T] {
186 return execG[T]{g: &g[T]{

Callers 15

ExecMethod · 0.95
CreateMethod · 0.80
CreateInBatchesMethod · 0.80
getInstanceMethod · 0.80
DeleteMethod · 0.80
UpdateMethod · 0.80
UpdatesMethod · 0.80
CountMethod · 0.80
FirstMethod · 0.80
ScanMethod · 0.80
LastMethod · 0.80
TakeMethod · 0.80

Calls 3

opFuncType · 0.85
SessionMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected