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

Method QueryFile

ent/entity_query.go:68–87  ·  view source on GitHub ↗

QueryFile chains the current query on the "file" edge.

()

Source from the content-addressed store, hash-verified

66
67// QueryFile chains the current query on the "file" edge.
68func (eq *EntityQuery) QueryFile() *FileQuery {
69 query := (&FileClient{config: eq.config}).Query()
70 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
71 if err := eq.prepareQuery(ctx); err != nil {
72 return nil, err
73 }
74 selector := eq.sqlQuery(ctx)
75 if err := selector.Err(); err != nil {
76 return nil, err
77 }
78 step := sqlgraph.NewStep(
79 sqlgraph.From(entity.Table, entity.FieldID, selector),
80 sqlgraph.To(file.Table, file.FieldID),
81 sqlgraph.Edge(sqlgraph.M2M, true, entity.FileTable, entity.FilePrimaryKey...),
82 )
83 fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step)
84 return fromU, nil
85 }
86 return query
87}
88
89// QueryUser chains the current query on the "user" edge.
90func (eq *EntityQuery) QueryUser() *UserQuery {

Callers

nothing calls this directly

Calls 5

prepareQueryMethod · 0.95
sqlQueryMethod · 0.95
DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected