MCPcopy Index your code
hub / github.com/chainloop-dev/chainloop / prepareQuery

Method prepareQuery

app/controlplane/pkg/data/ent/user_query.go:384–408  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

382}
383
384func (_q *UserQuery) prepareQuery(ctx context.Context) error {
385 for _, inter := range _q.inters {
386 if inter == nil {
387 return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
388 }
389 if trv, ok := inter.(Traverser); ok {
390 if err := trv.Traverse(ctx, _q); err != nil {
391 return err
392 }
393 }
394 }
395 for _, f := range _q.ctx.Fields {
396 if !user.ValidColumn(f) {
397 return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
398 }
399 }
400 if _q.path != nil {
401 prev, err := _q.path(ctx)
402 if err != nil {
403 return err
404 }
405 _q.sql = prev
406 }
407 return nil
408}
409
410func (_q *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, error) {
411 var (

Callers 6

QueryMembershipsMethod · 0.95
QueryGroupMembershipsMethod · 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