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

Method IDs

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

9156// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
9157// or updated by the mutation.
9158func (m *OrganizationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
9159 switch {
9160 case m.op.Is(OpUpdateOne | OpDeleteOne):
9161 id, exists := m.ID()
9162 if exists {
9163 return []uuid.UUID{id}, nil
9164 }
9165 fallthrough
9166 case m.op.Is(OpUpdate | OpDelete):
9167 return m.Client().Organization.Query().Where(m.predicates...).IDs(ctx)
9168 default:
9169 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
9170 }
9171}
9172
9173// SetName sets the "name" field.
9174func (m *OrganizationMutation) 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