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

Method QueryStoragePolicy

ent/entity_query.go:112–131  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

110
111// QueryStoragePolicy chains the current query on the "storage_policy" edge.
112func (eq *EntityQuery) QueryStoragePolicy() *StoragePolicyQuery {
113 query := (&StoragePolicyClient{config: eq.config}).Query()
114 query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
115 if err := eq.prepareQuery(ctx); err != nil {
116 return nil, err
117 }
118 selector := eq.sqlQuery(ctx)
119 if err := selector.Err(); err != nil {
120 return nil, err
121 }
122 step := sqlgraph.NewStep(
123 sqlgraph.From(entity.Table, entity.FieldID, selector),
124 sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID),
125 sqlgraph.Edge(sqlgraph.M2O, true, entity.StoragePolicyTable, entity.StoragePolicyColumn),
126 )
127 fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step)
128 return fromU, nil
129 }
130 return query
131}
132
133// First returns the first Entity entity from the query.
134// Returns a *NotFoundError when no Entity 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