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

Method FirstID

ent/gitcommit_query.go:113–123  ·  view source on GitHub ↗

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

(ctx context.Context)

Source from the content-addressed store, hash-verified

111// FirstID returns the first GitCommit ID from the query.
112// Returns a *NotFoundError when no GitCommit ID was found.
113func (gcq *GitCommitQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {
114 var ids []uuid.UUID
115 if ids, err = gcq.Limit(1).IDs(setContextOp(ctx, gcq.ctx, ent.OpQueryFirstID)); err != nil {
116 return
117 }
118 if len(ids) == 0 {
119 err = &NotFoundError{gitcommit.Label}
120 return
121 }
122 return ids[0], nil
123}
124
125// FirstIDX is like FirstID, but panics if an error occurs.
126func (gcq *GitCommitQuery) 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