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

Method prepareQuery

ent/user_query.go:631–655  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

629}
630
631func (uq *UserQuery) prepareQuery(ctx context.Context) error {
632 for _, inter := range uq.inters {
633 if inter == nil {
634 return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
635 }
636 if trv, ok := inter.(Traverser); ok {
637 if err := trv.Traverse(ctx, uq); err != nil {
638 return err
639 }
640 }
641 }
642 for _, f := range uq.ctx.Fields {
643 if !user.ValidColumn(f) {
644 return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
645 }
646 }
647 if uq.path != nil {
648 prev, err := uq.path(ctx)
649 if err != nil {
650 return err
651 }
652 uq.sql = prev
653 }
654 return nil
655}
656
657func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, error) {
658 var (

Callers 13

QueryGroupMethod · 0.95
QueryFilesMethod · 0.95
QueryDavAccountsMethod · 0.95
QuerySharesMethod · 0.95
QueryPasskeyMethod · 0.95
QueryTasksMethod · 0.95
QueryFseventsMethod · 0.95
QueryEntitiesMethod · 0.95
QueryOauthGrantsMethod · 0.95
AllMethod · 0.95
CountMethod · 0.95
ScanMethod · 0.45

Calls 2

ValidColumnFunction · 0.92
TraverseMethod · 0.45

Tested by

no test coverage detected