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

Method prepareQuery

ent/gitcommit_query.go:348–372  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

346}
347
348func (gcq *GitCommitQuery) prepareQuery(ctx context.Context) error {
349 for _, inter := range gcq.inters {
350 if inter == nil {
351 return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
352 }
353 if trv, ok := inter.(Traverser); ok {
354 if err := trv.Traverse(ctx, gcq); err != nil {
355 return err
356 }
357 }
358 }
359 for _, f := range gcq.ctx.Fields {
360 if !gitcommit.ValidColumn(f) {
361 return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
362 }
363 }
364 if gcq.path != nil {
365 prev, err := gcq.path(ctx)
366 if err != nil {
367 return err
368 }
369 gcq.sql = prev
370 }
371 return nil
372}
373
374func (gcq *GitCommitQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GitCommit, error) {
375 var (

Callers 5

QueryResultsMethod · 0.95
AllMethod · 0.95
CountMethod · 0.95
ScanMethod · 0.45
ScanMethod · 0.45

Calls 1

ValidColumnFunction · 0.92

Tested by

no test coverage detected