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.
()
| 293 | // Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be |
| 294 | // used to prepare common query builders and use them differently after the clone is made. |
| 295 | func (_q *UserQuery) Clone() *UserQuery { |
| 296 | if _q == nil { |
| 297 | return nil |
| 298 | } |
| 299 | return &UserQuery{ |
| 300 | config: _q.config, |
| 301 | ctx: _q.ctx.Clone(), |
| 302 | order: append([]user.OrderOption{}, _q.order...), |
| 303 | inters: append([]Interceptor{}, _q.inters...), |
| 304 | predicates: append([]predicate.User{}, _q.predicates...), |
| 305 | withMemberships: _q.withMemberships.Clone(), |
| 306 | withGroupMemberships: _q.withGroupMemberships.Clone(), |
| 307 | // clone intermediate query. |
| 308 | sql: _q.sql.Clone(), |
| 309 | path: _q.path, |
| 310 | modifiers: append([]func(*sql.Selector){}, _q.modifiers...), |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | // WithMemberships tells the query-builder to eager-load the nodes that are connected to |
| 315 | // the "memberships" edge. The optional arguments are used to configure the query builder of the edge. |
no outgoing calls
no test coverage detected