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

Method IDs

app/controlplane/pkg/data/ent/mutation.go:4008–4021  ·  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

4006// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
4007// or updated by the mutation.
4008func (m *GroupMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
4009 switch {
4010 case m.op.Is(OpUpdateOne | OpDeleteOne):
4011 id, exists := m.ID()
4012 if exists {
4013 return []uuid.UUID{id}, nil
4014 }
4015 fallthrough
4016 case m.op.Is(OpUpdate | OpDelete):
4017 return m.Client().Group.Query().Where(m.predicates...).IDs(ctx)
4018 default:
4019 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
4020 }
4021}
4022
4023// SetName sets the "name" field.
4024func (m *GroupMutation) 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