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

Method Clone

ent/metadata_query.go:266–281  ·  view source on GitHub ↗

Clone returns a duplicate of the MetadataQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

()

Source from the content-addressed store, hash-verified

264// Clone returns a duplicate of the MetadataQuery builder, including all associated steps. It can be
265// used to prepare common query builders and use them differently after the clone is made.
266func (mq *MetadataQuery) Clone() *MetadataQuery {
267 if mq == nil {
268 return nil
269 }
270 return &MetadataQuery{
271 config: mq.config,
272 ctx: mq.ctx.Clone(),
273 order: append([]metadata.OrderOption{}, mq.order...),
274 inters: append([]Interceptor{}, mq.inters...),
275 predicates: append([]predicate.Metadata{}, mq.predicates...),
276 withFile: mq.withFile.Clone(),
277 // clone intermediate query.
278 sql: mq.sql.Clone(),
279 path: mq.path,
280 }
281}
282
283// WithFile tells the query-builder to eager-load the nodes that are connected to
284// the "file" edge. The optional arguments are used to configure the query builder of the edge.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected