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

Method IDs

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

1877// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
1878// or updated by the mutation.
1879func (m *CASBackendMutation) IDs(ctx context.Context) ([]uuid.UUID, error) {
1880 switch {
1881 case m.op.Is(OpUpdateOne | OpDeleteOne):
1882 id, exists := m.ID()
1883 if exists {
1884 return []uuid.UUID{id}, nil
1885 }
1886 fallthrough
1887 case m.op.Is(OpUpdate | OpDelete):
1888 return m.Client().CASBackend.Query().Where(m.predicates...).IDs(ctx)
1889 default:
1890 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
1891 }
1892}
1893
1894// SetLocation sets the "location" field.
1895func (m *CASBackendMutation) SetLocation(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