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

Method IDs

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

187// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
188// or updated by the mutation.
189func (m *APITokenMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
190 switch {
191 case m.op.Is(OpUpdateOne | OpDeleteOne):
192 id, exists := m.ID()
193 if exists {
194 return []uuid.UUID{id}, nil
195 }
196 fallthrough
197 case m.op.Is(OpUpdate | OpDelete):
198 return m.Client().APIToken.Query().Where(m.predicates...).IDs(ctx)
199 default:
200 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
201 }
202}
203
204// SetName sets the "name" field.
205func (m *APITokenMutation) 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