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

Method QueryShares

ent/client.go:1024–1037  ·  view source on GitHub ↗

QueryShares queries the shares edge of a File.

(f *File)

Source from the content-addressed store, hash-verified

1022
1023// QueryShares queries the shares edge of a File.
1024func (c *FileClient) QueryShares(f *File) *ShareQuery {
1025 query := (&ShareClient{config: c.config}).Query()
1026 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1027 id := f.ID
1028 step := sqlgraph.NewStep(
1029 sqlgraph.From(file.Table, file.FieldID, id),
1030 sqlgraph.To(share.Table, share.FieldID),
1031 sqlgraph.Edge(sqlgraph.O2M, false, file.SharesTable, file.SharesColumn),
1032 )
1033 fromV = sqlgraph.Neighbors(f.driver.Dialect(), step)
1034 return fromV, nil
1035 }
1036 return query
1037}
1038
1039// QueryDirectLinks queries the direct_links edge of a File.
1040func (c *FileClient) QueryDirectLinks(f *File) *DirectLinkQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected