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

Method IDs

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

7123// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
7124// or updated by the mutation.
7125func (m *MembershipMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
7126 switch {
7127 case m.op.Is(OpUpdateOne | OpDeleteOne):
7128 id, exists := m.ID()
7129 if exists {
7130 return []uuid.UUID{id}, nil
7131 }
7132 fallthrough
7133 case m.op.Is(OpUpdate | OpDelete):
7134 return m.Client().Membership.Query().Where(m.predicates...).IDs(ctx)
7135 default:
7136 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
7137 }
7138}
7139
7140// SetCurrent sets the "current" field.
7141func (m *MembershipMutation) SetCurrent(b bool) {

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