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

Method QueryFile

ent/client.go:1508–1521  ·  view source on GitHub ↗

QueryFile queries the file edge of a Metadata.

(m *Metadata)

Source from the content-addressed store, hash-verified

1506
1507// QueryFile queries the file edge of a Metadata.
1508func (c *MetadataClient) QueryFile(m *Metadata) *FileQuery {
1509 query := (&FileClient{config: c.config}).Query()
1510 query.path = func(context.Context) (fromV *sql.Selector, _ error) {
1511 id := m.ID
1512 step := sqlgraph.NewStep(
1513 sqlgraph.From(metadata.Table, metadata.FieldID, id),
1514 sqlgraph.To(file.Table, file.FieldID),
1515 sqlgraph.Edge(sqlgraph.M2O, true, metadata.FileTable, metadata.FileColumn),
1516 )
1517 fromV = sqlgraph.Neighbors(m.driver.Dialect(), step)
1518 return fromV, nil
1519 }
1520 return query
1521}
1522
1523// Hooks returns the client hooks.
1524func (c *MetadataClient) Hooks() []Hook {

Callers

nothing calls this directly

Calls 3

DialectMethod · 0.80
ToMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected