MCPcopy Create free account
hub / github.com/cloudwan/gohan / Within

Function Within

db/db.go:165–169  ·  view source on GitHub ↗

Within executes a scoped transaction on a database

(db DB, fn func(transaction.Transaction) error)

Source from the content-addressed store, hash-verified

163
164// Within executes a scoped transaction on a database
165func Within(db DB, fn func(transaction.Transaction) error) error {
166 return withinDatabase(db, fn, func() (ITransaction, error) {
167 return db.Begin()
168 })
169}
170
171// WithinTx executes a scoped transaction with options on a database
172func WithinTx(ctx context.Context, db DB, options *transaction.TxOptions, fn func(transaction.Transaction) error) error {

Callers 1

CopyDBResourcesFunction · 0.85

Calls 2

withinDatabaseFunction · 0.85
BeginMethod · 0.65

Tested by

no test coverage detected