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

Method QueryParent

ent/client.go:960–973  ·  view source on GitHub ↗

QueryParent queries the parent edge of a File.

(f *File)

Source from the content-addressed store, hash-verified

958
959// QueryParent queries the parent edge of a File.
960func (c *FileClient) QueryParent(f *File) *FileQuery {
961 query := (&FileClient{config: c.config}).Query()
962 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
963 id := f.ID
964 step := sqlgraph.NewStep(
965 sqlgraph.From(file.Table, file.FieldID, id),
966 sqlgraph.To(file.Table, file.FieldID),
967 sqlgraph.Edge(sqlgraph.M2O, true, file.ParentTable, file.ParentColumn),
968 )
969 fromV = sqlgraph.Neighbors(f.driver.Dialect(), step)
970 return fromV, nil
971 }
972 return query
973}
974
975// QueryChildren queries the children edge of a File.
976func (c *FileClient) QueryChildren(f *File) *FileQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected