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

Method IDs

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

1366// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
1367// or updated by the mutation.
1368func (m *AttestationMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
1369 switch {
1370 case m.op.Is(OpUpdateOne | OpDeleteOne):
1371 id, exists := m.ID()
1372 if exists {
1373 return []uuid.UUID{id}, nil
1374 }
1375 fallthrough
1376 case m.op.Is(OpUpdate | OpDelete):
1377 return m.Client().Attestation.Query().Where(m.predicates...).IDs(ctx)
1378 default:
1379 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
1380 }
1381}
1382
1383// SetCreatedAt sets the "created_at" field.
1384func (m *AttestationMutation) SetCreatedAt(t time.Time) {

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