MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / prepareQuery

Method prepareQuery

ent/group_query.go:379–403  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

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

Callers 6

QueryUsersMethod · 0.95
QueryStoragePoliciesMethod · 0.95
AllMethod · 0.95
CountMethod · 0.95
ScanMethod · 0.45
ScanMethod · 0.45

Calls 2

ValidColumnFunction · 0.92
TraverseMethod · 0.45

Tested by

no test coverage detected