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

Method QueryFile

ent/client.go:2430–2443  ·  view source on GitHub ↗

QueryFile queries the file edge of a Share.

(s *Share)

Source from the content-addressed store, hash-verified

2428
2429// QueryFile queries the file edge of a Share.
2430func (c *ShareClient) QueryFile(s *Share) *FileQuery {
2431 query := (&FileClient{config: c.config}).Query()
2432 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
2433 id := s.ID
2434 step := sqlgraph.NewStep(
2435 sqlgraph.From(share.Table, share.FieldID, id),
2436 sqlgraph.To(file.Table, file.FieldID),
2437 sqlgraph.Edge(sqlgraph.M2O, true, share.FileTable, share.FileColumn),
2438 )
2439 fromV = sqlgraph.Neighbors(s.driver.Dialect(), step)
2440 return fromV, nil
2441 }
2442 return query
2443}
2444
2445// Hooks returns the client hooks.
2446func (c *ShareClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected