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

Method WithContext

gorm.go:363–365  ·  view source on GitHub ↗

WithContext change current instance db's context to ctx

(ctx context.Context)

Source from the content-addressed store, hash-verified

361
362// WithContext change current instance db's context to ctx
363func (db *DB) WithContext(ctx context.Context) *DB {
364 return db.Session(&Session{Context: ctx})
365}
366
367// Debug start debug mode
368func (db *DB) Debug() (tx *DB) {

Callers 4

TestCancelTransactionFunction · 0.80
TestScopesFunction · 0.80
TestPreparedStmtFunction · 0.80

Calls 1

SessionMethod · 0.95

Tested by 4

TestCancelTransactionFunction · 0.64
TestScopesFunction · 0.64
TestPreparedStmtFunction · 0.64