MCPcopy Create free account
hub / github.com/Comfy-Org/registry-backend / Exist

Method Exist

ent/gitcommit_query.go:248–258  ·  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

246
247// Exist returns true if the query has elements in the graph.
248func (gcq *GitCommitQuery) Exist(ctx context.Context) (bool, error) {
249 ctx = setContextOp(ctx, gcq.ctx, ent.OpQueryExist)
250 switch _, err := gcq.FirstID(ctx); {
251 case IsNotFound(err):
252 return false, nil
253 case err != nil:
254 return false, fmt.Errorf("ent: check existence: %w", err)
255 default:
256 return true, nil
257 }
258}
259
260// ExistX is like Exist, but panics if an error occurs.
261func (gcq *GitCommitQuery) ExistX(ctx context.Context) bool {

Callers 1

ExistXMethod · 0.95

Calls 3

FirstIDMethod · 0.95
setContextOpFunction · 0.85
IsNotFoundFunction · 0.85

Tested by

no test coverage detected