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

Method FirstID

ent/storagefile_query.go:89–99  ·  view source on GitHub ↗

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

(ctx context.Context)

Source from the content-addressed store, hash-verified

87// FirstID returns the first StorageFile ID from the query.
88// Returns a *NotFoundError when no StorageFile ID was found.
89func (sfq *StorageFileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {
90 var ids []uuid.UUID
91 if ids, err = sfq.Limit(1).IDs(setContextOp(ctx, sfq.ctx, ent.OpQueryFirstID)); err != nil {
92 return
93 }
94 if len(ids) == 0 {
95 err = &NotFoundError{storagefile.Label}
96 return
97 }
98 return ids[0], nil
99}
100
101// FirstIDX is like FirstID, but panics if an error occurs.
102func (sfq *StorageFileQuery) 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