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

Method IDs

app/controlplane/pkg/data/ent/mutation.go:5604–5617  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5602// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
5603// or updated by the mutation.
5604func (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.
5620func (m *IntegrationMutation) SetName(s string) {

Callers

nothing calls this directly

Calls 5

IDMethod · 0.95
ClientMethod · 0.95
IDsMethod · 0.45
WhereMethod · 0.45
QueryMethod · 0.45

Tested by

no test coverage detected