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

Method QueryStoragePolicy

ent/node_query.go:64–83  ·  view source on GitHub ↗

QueryStoragePolicy chains the current query on the "storage_policy" edge.

()

Source from the content-addressed store, hash-verified

62
63// QueryStoragePolicy chains the current query on the "storage_policy" edge.
64func (nq *NodeQuery) QueryStoragePolicy() *StoragePolicyQuery {
65 query := (&StoragePolicyClient{config: nq.config}).Query()
66 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
67 if err := nq.prepareQuery(ctx); err != nil {
68 return nil, err
69 }
70 selector := nq.sqlQuery(ctx)
71 if err := selector.Err(); err != nil {
72 return nil, err
73 }
74 step := sqlgraph.NewStep(
75 sqlgraph.From(node.Table, node.FieldID, selector),
76 sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID),
77 sqlgraph.Edge(sqlgraph.O2M, false, node.StoragePolicyTable, node.StoragePolicyColumn),
78 )
79 fromU = sqlgraph.SetNeighbors(nq.driver.Dialect(), step)
80 return fromU, nil
81 }
82 return query
83}
84
85// First returns the first Node entity from the query.
86// Returns a *NotFoundError when no Node was found.

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