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

Method QueryStoragePolicy

ent/client.go:1659–1672  ·  view source on GitHub ↗

QueryStoragePolicy queries the storage_policy edge of a Node.

(n *Node)

Source from the content-addressed store, hash-verified

1657
1658// QueryStoragePolicy queries the storage_policy edge of a Node.
1659func (c *NodeClient) QueryStoragePolicy(n *Node) *StoragePolicyQuery {
1660 query := (&StoragePolicyClient{config: c.config}).Query()
1661 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1662 id := n.ID
1663 step := sqlgraph.NewStep(
1664 sqlgraph.From(node.Table, node.FieldID, id),
1665 sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID),
1666 sqlgraph.Edge(sqlgraph.O2M, false, node.StoragePolicyTable, node.StoragePolicyColumn),
1667 )
1668 fromV = sqlgraph.Neighbors(n.driver.Dialect(), step)
1669 return fromV, nil
1670 }
1671 return query
1672}
1673
1674// Hooks returns the client hooks.
1675func (c *NodeClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected