IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
(ctx context.Context)
| 5602 | // as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated |
| 5603 | // or updated by the mutation. |
| 5604 | func (m *IntegrationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) { |
| 5605 | switch { |
| 5606 | case m.op.Is(OpUpdateOne | OpDeleteOne): |
| 5607 | id, exists := m.ID() |
| 5608 | if exists { |
| 5609 | return []uuid.UUID{id}, nil |
| 5610 | } |
| 5611 | fallthrough |
| 5612 | case m.op.Is(OpUpdate | OpDelete): |
| 5613 | return m.Client().Integration.Query().Where(m.predicates...).IDs(ctx) |
| 5614 | default: |
| 5615 | return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op) |
| 5616 | } |
| 5617 | } |
| 5618 | |
| 5619 | // SetName sets the "name" field. |
| 5620 | func (m *IntegrationMutation) SetName(s string) { |