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

Method QueryStoragePolicy

ent/client.go:777–790  ·  view source on GitHub ↗

QueryStoragePolicy queries the storage_policy edge of a Entity.

(e *Entity)

Source from the content-addressed store, hash-verified

775
776// QueryStoragePolicy queries the storage_policy edge of a Entity.
777func (c *EntityClient) QueryStoragePolicy(e *Entity) *StoragePolicyQuery {
778 query := (&StoragePolicyClient{config: c.config}).Query()
779 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
780 id := e.ID
781 step := sqlgraph.NewStep(
782 sqlgraph.From(entity.Table, entity.FieldID, id),
783 sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID),
784 sqlgraph.Edge(sqlgraph.M2O, true, entity.StoragePolicyTable, entity.StoragePolicyColumn),
785 )
786 fromV = sqlgraph.Neighbors(e.driver.Dialect(), step)
787 return fromV, nil
788 }
789 return query
790}
791
792// Hooks returns the client hooks.
793func (c *EntityClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected