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