Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
()
| 5574 | // Tx returns an `ent.Tx` for mutations that were executed in transactions; |
| 5575 | // it returns an error otherwise. |
| 5576 | func (m IntegrationMutation) Tx() (*Tx, error) { |
| 5577 | if _, ok := m.driver.(*txDriver); !ok { |
| 5578 | return nil, errors.New("ent: mutation is not running in a transaction") |
| 5579 | } |
| 5580 | tx := &Tx{config: m.config} |
| 5581 | tx.init() |
| 5582 | return tx, nil |
| 5583 | } |
| 5584 | |
| 5585 | // SetID sets the value of the id field. Note that this |
| 5586 | // operation is only accepted on creation of Integration entities. |