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

Method QueryFiles

ent/client.go:2597–2610  ·  view source on GitHub ↗

QueryFiles queries the files edge of a StoragePolicy.

(sp *StoragePolicy)

Source from the content-addressed store, hash-verified

2595
2596// QueryFiles queries the files edge of a StoragePolicy.
2597func (c *StoragePolicyClient) QueryFiles(sp *StoragePolicy) *FileQuery {
2598 query := (&FileClient{config: c.config}).Query()
2599 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
2600 id := sp.ID
2601 step := sqlgraph.NewStep(
2602 sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, id),
2603 sqlgraph.To(file.Table, file.FieldID),
2604 sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.FilesTable, storagepolicy.FilesColumn),
2605 )
2606 fromV = sqlgraph.Neighbors(sp.driver.Dialect(), step)
2607 return fromV, nil
2608 }
2609 return query
2610}
2611
2612// QueryEntities queries the entities edge of a StoragePolicy.
2613func (c *StoragePolicyClient) QueryEntities(sp *StoragePolicy) *EntityQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected