MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newTx

Function newTx

app/controlplane/pkg/data/ent/tx.go:231–237  ·  view source on GitHub ↗

newTx creates a new transactional driver.

(ctx context.Context, drv dialect.Driver)

Source from the content-addressed store, hash-verified

229
230// newTx creates a new transactional driver.
231func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) {
232 tx, err := drv.Tx(ctx)
233 if err != nil {
234 return nil, err
235 }
236 return &txDriver{tx: tx, drv: drv}, nil
237}
238
239// Tx returns the transaction wrapper (txDriver) to avoid Commit or Rollback calls
240// from the internal builders. Should be called only by the internal builders.

Callers 1

TxMethod · 0.85

Calls 1

TxMethod · 0.45

Tested by

no test coverage detected