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

Method QueryEntities

ent/client.go:1008–1021  ·  view source on GitHub ↗

QueryEntities queries the entities edge of a File.

(f *File)

Source from the content-addressed store, hash-verified

1006
1007// QueryEntities queries the entities edge of a File.
1008func (c *FileClient) QueryEntities(f *File) *EntityQuery {
1009 query := (&EntityClient{config: c.config}).Query()
1010 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1011 id := f.ID
1012 step := sqlgraph.NewStep(
1013 sqlgraph.From(file.Table, file.FieldID, id),
1014 sqlgraph.To(entity.Table, entity.FieldID),
1015 sqlgraph.Edge(sqlgraph.M2M, false, file.EntitiesTable, file.EntitiesPrimaryKey...),
1016 )
1017 fromV = sqlgraph.Neighbors(f.driver.Dialect(), step)
1018 return fromV, nil
1019 }
1020 return query
1021}
1022
1023// QueryShares queries the shares edge of a File.
1024func (c *FileClient) QueryShares(f *File) *ShareQuery {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected