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

Method IDs

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

14326// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
14327// or updated by the mutation.
14328func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
14329 switch {
14330 case m.op.Is(OpUpdateOne | OpDeleteOne):
14331 id, exists := m.ID()
14332 if exists {
14333 return []uuid.UUID{id}, nil
14334 }
14335 fallthrough
14336 case m.op.Is(OpUpdate | OpDelete):
14337 return m.Client().User.Query().Where(m.predicates...).IDs(ctx)
14338 default:
14339 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
14340 }
14341}
14342
14343// SetEmail sets the "email" field.
14344func (m *UserMutation) SetEmail(s string) {

Callers 15

IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45

Calls 4

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

Tested by

no test coverage detected