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

Method IDs

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

10978// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
10979// or updated by the mutation.
10980func (m *ProjectMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
10981 switch {
10982 case m.op.Is(OpUpdateOne | OpDeleteOne):
10983 id, exists := m.ID()
10984 if exists {
10985 return []uuid.UUID{id}, nil
10986 }
10987 fallthrough
10988 case m.op.Is(OpUpdate | OpDelete):
10989 return m.Client().Project.Query().Where(m.predicates...).IDs(ctx)
10990 default:
10991 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
10992 }
10993}
10994
10995// SetName sets the "name" field.
10996func (m *ProjectMutation) 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