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

Method Exist

app/controlplane/pkg/data/ent/user_query.go:272–282  ·  view source on GitHub ↗

Exist returns true if the query has elements in the graph.

(ctx context.Context)

Source from the content-addressed store, hash-verified

270
271// Exist returns true if the query has elements in the graph.
272func (_q *UserQuery) Exist(ctx context.Context) (bool, error) {
273 ctx = setContextOp(ctx, _q.ctx, ent.OpQueryExist)
274 switch _, err := _q.FirstID(ctx); {
275 case IsNotFound(err):
276 return false, nil
277 case err != nil:
278 return false, fmt.Errorf("ent: check existence: %w", err)
279 default:
280 return true, nil
281 }
282}
283
284// ExistX is like Exist, but panics if an error occurs.
285func (_q *UserQuery) ExistX(ctx context.Context) bool {

Callers 1

ExistXMethod · 0.95

Calls 3

FirstIDMethod · 0.95
setContextOpFunction · 0.85
IsNotFoundFunction · 0.70

Tested by

no test coverage detected