MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / Tx

Method Tx

ent/mutation.go:6477–6484  ·  view source on GitHub ↗

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

()

Source from the content-addressed store, hash-verified

6475// Tx returns an `ent.Tx` for mutations that were executed in transactions;
6476// it returns an error otherwise.
6477func (m MetadataMutation) Tx() (*Tx, error) {
6478 if _, ok := m.driver.(*txDriver); !ok {
6479 return nil, errors.New("ent: mutation is not running in a transaction")
6480 }
6481 tx := &Tx{config: m.config}
6482 tx.init()
6483 return tx, nil
6484}
6485
6486// ID returns the ID value in the mutation. Note that the ID is only available
6487// if it was provided to the builder or after it was returned from the database.

Callers

nothing calls this directly

Calls 2

initMethod · 0.95
NewMethod · 0.65

Tested by

no test coverage detected