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

Method IDs

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

3255// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
3256// or updated by the mutation.
3257func (m *CASMappingMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
3258 switch {
3259 case m.op.Is(OpUpdateOne | OpDeleteOne):
3260 id, exists := m.ID()
3261 if exists {
3262 return []uuid.UUID{id}, nil
3263 }
3264 fallthrough
3265 case m.op.Is(OpUpdate | OpDelete):
3266 return m.Client().CASMapping.Query().Where(m.predicates...).IDs(ctx)
3267 default:
3268 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
3269 }
3270}
3271
3272// SetDigest sets the "digest" field.
3273func (m *CASMappingMutation) SetDigest(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