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

Method Clone

ent/user_query.go:459–482  ·  view source on GitHub ↗

Clone returns a duplicate of the UserQuery 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

457// Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be
458// used to prepare common query builders and use them differently after the clone is made.
459func (uq *UserQuery) Clone() *UserQuery {
460 if uq == nil {
461 return nil
462 }
463 return &UserQuery{
464 config: uq.config,
465 ctx: uq.ctx.Clone(),
466 order: append([]user.OrderOption{}, uq.order...),
467 inters: append([]Interceptor{}, uq.inters...),
468 predicates: append([]predicate.User{}, uq.predicates...),
469 withGroup: uq.withGroup.Clone(),
470 withFiles: uq.withFiles.Clone(),
471 withDavAccounts: uq.withDavAccounts.Clone(),
472 withShares: uq.withShares.Clone(),
473 withPasskey: uq.withPasskey.Clone(),
474 withTasks: uq.withTasks.Clone(),
475 withFsevents: uq.withFsevents.Clone(),
476 withEntities: uq.withEntities.Clone(),
477 withOauthGrants: uq.withOauthGrants.Clone(),
478 // clone intermediate query.
479 sql: uq.sql.Clone(),
480 path: uq.path,
481 }
482}
483
484// WithGroup tells the query-builder to eager-load the nodes that are connected to
485// the "group" 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