Clone returns a duplicate of the MetadataQuery 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 MetadataQuery 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 (mq *MetadataQuery) Clone() *MetadataQuery { |
| 267 | if mq == nil { |
| 268 | return nil |
| 269 | } |
| 270 | return &MetadataQuery{ |
| 271 | config: mq.config, |
| 272 | ctx: mq.ctx.Clone(), |
| 273 | order: append([]metadata.OrderOption{}, mq.order...), |
| 274 | inters: append([]Interceptor{}, mq.inters...), |
| 275 | predicates: append([]predicate.Metadata{}, mq.predicates...), |
| 276 | withFile: mq.withFile.Clone(), |
| 277 | // clone intermediate query. |
| 278 | sql: mq.sql.Clone(), |
| 279 | path: mq.path, |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // WithFile tells the query-builder to eager-load the nodes that are connected to |
| 284 | // the "file" 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