Clone returns a duplicate of the ShareQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
()
| 289 | // Clone returns a duplicate of the ShareQuery builder, including all associated steps. It can be |
| 290 | // used to prepare common query builders and use them differently after the clone is made. |
| 291 | func (sq *ShareQuery) Clone() *ShareQuery { |
| 292 | if sq == nil { |
| 293 | return nil |
| 294 | } |
| 295 | return &ShareQuery{ |
| 296 | config: sq.config, |
| 297 | ctx: sq.ctx.Clone(), |
| 298 | order: append([]share.OrderOption{}, sq.order...), |
| 299 | inters: append([]Interceptor{}, sq.inters...), |
| 300 | predicates: append([]predicate.Share{}, sq.predicates...), |
| 301 | withUser: sq.withUser.Clone(), |
| 302 | withFile: sq.withFile.Clone(), |
| 303 | // clone intermediate query. |
| 304 | sql: sq.sql.Clone(), |
| 305 | path: sq.path, |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | // WithUser tells the query-builder to eager-load the nodes that are connected to |
| 310 | // 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