MCPcopy
hub / github.com/jmoiron/sqlx / Beginx

Method Beginx

sqlx.go:341–347  ·  view source on GitHub ↗

Beginx begins a transaction and returns an *sqlx.Tx instead of an *sql.Tx.

()

Source from the content-addressed store, hash-verified

339
340// Beginx begins a transaction and returns an *sqlx.Tx instead of an *sql.Tx.
341func (db *DB) Beginx() (*Tx, error) {
342 tx, err := db.DB.Begin()
343 if err != nil {
344 return nil, err
345 }
346 return &Tx{Tx: tx, driverName: db.driverName, unsafe: db.unsafe, Mapper: db.Mapper}, err
347}
348
349// Queryx queries the database and returns an *sqlx.Rows.
350// Any placeholder parameters are replaced with supplied args.

Callers 3

MustBeginMethod · 0.95
TestUsageFunction · 0.80
TestUsageContextFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestUsageFunction · 0.64
TestUsageContextFunction · 0.64