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

Method FirstID

ent/nodeversion_query.go:162–172  ·  view source on GitHub ↗

FirstID returns the first NodeVersion ID from the query. Returns a *NotFoundError when no NodeVersion ID was found.

(ctx context.Context)

Source from the content-addressed store, hash-verified

160// FirstID returns the first NodeVersion ID from the query.
161// Returns a *NotFoundError when no NodeVersion ID was found.
162func (nvq *NodeVersionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {
163 var ids []uuid.UUID
164 if ids, err = nvq.Limit(1).IDs(setContextOp(ctx, nvq.ctx, ent.OpQueryFirstID)); err != nil {
165 return
166 }
167 if len(ids) == 0 {
168 err = &NotFoundError{nodeversion.Label}
169 return
170 }
171 return ids[0], nil
172}
173
174// FirstIDX is like FirstID, but panics if an error occurs.
175func (nvq *NodeVersionQuery) FirstIDX(ctx context.Context) uuid.UUID {

Callers 2

FirstIDXMethod · 0.95
ExistMethod · 0.95

Calls 3

LimitMethod · 0.95
setContextOpFunction · 0.85
IDsMethod · 0.45

Tested by

no test coverage detected