MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / QueryFiles

Method QueryFiles

ent/storagepolicy_query.go:92–111  ·  view source on GitHub ↗

QueryFiles chains the current query on the "files" edge.

()

Source from the content-addressed store, hash-verified

90
91// QueryFiles chains the current query on the "files" edge.
92func (spq *StoragePolicyQuery) QueryFiles() *FileQuery {
93 query := (&FileClient{config: spq.config}).Query()
94 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
95 if err := spq.prepareQuery(ctx); err != nil {
96 return nil, err
97 }
98 selector := spq.sqlQuery(ctx)
99 if err := selector.Err(); err != nil {
100 return nil, err
101 }
102 step := sqlgraph.NewStep(
103 sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, selector),
104 sqlgraph.To(file.Table, file.FieldID),
105 sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.FilesTable, storagepolicy.FilesColumn),
106 )
107 fromU = sqlgraph.SetNeighbors(spq.driver.Dialect(), step)
108 return fromU, nil
109 }
110 return query
111}
112
113// QueryEntities chains the current query on the "entities" edge.
114func (spq *StoragePolicyQuery) QueryEntities() *EntityQuery {

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