Clone returns a duplicate of the TaskQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
()
| 264 | // Clone returns a duplicate of the TaskQuery builder, including all associated steps. It can be |
| 265 | // used to prepare common query builders and use them differently after the clone is made. |
| 266 | func (tq *TaskQuery) Clone() *TaskQuery { |
| 267 | if tq == nil { |
| 268 | return nil |
| 269 | } |
| 270 | return &TaskQuery{ |
| 271 | config: tq.config, |
| 272 | ctx: tq.ctx.Clone(), |
| 273 | order: append([]task.OrderOption{}, tq.order...), |
| 274 | inters: append([]Interceptor{}, tq.inters...), |
| 275 | predicates: append([]predicate.Task{}, tq.predicates...), |
| 276 | withUser: tq.withUser.Clone(), |
| 277 | // clone intermediate query. |
| 278 | sql: tq.sql.Clone(), |
| 279 | path: tq.path, |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // WithUser tells the query-builder to eager-load the nodes that are connected to |
| 284 | // the "user" edge. The optional arguments are used to configure the query builder of the edge. |
nothing calls this directly
no outgoing calls
no test coverage detected