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

Method QueryNode

ent/client.go:2629–2642  ·  view source on GitHub ↗

QueryNode queries the node edge of a StoragePolicy.

(sp *StoragePolicy)

Source from the content-addressed store, hash-verified

2627
2628// QueryNode queries the node edge of a StoragePolicy.
2629func (c *StoragePolicyClient) QueryNode(sp *StoragePolicy) *NodeQuery {
2630 query := (&NodeClient{config: c.config}).Query()
2631 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
2632 id := sp.ID
2633 step := sqlgraph.NewStep(
2634 sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, id),
2635 sqlgraph.To(node.Table, node.FieldID),
2636 sqlgraph.Edge(sqlgraph.M2O, true, storagepolicy.NodeTable, storagepolicy.NodeColumn),
2637 )
2638 fromV = sqlgraph.Neighbors(sp.driver.Dialect(), step)
2639 return fromV, nil
2640 }
2641 return query
2642}
2643
2644// Hooks returns the client hooks.
2645func (c *StoragePolicyClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected