(ctx context.Context, hooks ...queryHook)
| 445 | } |
| 446 | |
| 447 | func (nvq *NodeVersionQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*NodeVersion, error) { |
| 448 | var ( |
| 449 | nodes = []*NodeVersion{} |
| 450 | withFKs = nvq.withFKs |
| 451 | _spec = nvq.querySpec() |
| 452 | loadedTypes = [3]bool{ |
| 453 | nvq.withNode != nil, |
| 454 | nvq.withStorageFile != nil, |
| 455 | nvq.withComfyNodes != nil, |
| 456 | } |
| 457 | ) |
| 458 | if nvq.withStorageFile != nil { |
| 459 | withFKs = true |
| 460 | } |
| 461 | if withFKs { |
| 462 | _spec.Node.Columns = append(_spec.Node.Columns, nodeversion.ForeignKeys...) |
| 463 | } |
| 464 | _spec.ScanValues = func(columns []string) ([]any, error) { |
| 465 | return (*NodeVersion).scanValues(nil, columns) |
| 466 | } |
| 467 | _spec.Assign = func(columns []string, values []any) error { |
| 468 | node := &NodeVersion{config: nvq.config} |
| 469 | nodes = append(nodes, node) |
| 470 | node.Edges.loadedTypes = loadedTypes |
| 471 | return node.assignValues(columns, values) |
| 472 | } |
| 473 | if len(nvq.modifiers) > 0 { |
| 474 | _spec.Modifiers = nvq.modifiers |
| 475 | } |
| 476 | for i := range hooks { |
| 477 | hooks[i](ctx, _spec) |
| 478 | } |
| 479 | if err := sqlgraph.QueryNodes(ctx, nvq.driver, _spec); err != nil { |
| 480 | return nil, err |
| 481 | } |
| 482 | if len(nodes) == 0 { |
| 483 | return nodes, nil |
| 484 | } |
| 485 | if query := nvq.withNode; query != nil { |
| 486 | if err := nvq.loadNode(ctx, query, nodes, nil, |
| 487 | func(n *NodeVersion, e *Node) { n.Edges.Node = e }); err != nil { |
| 488 | return nil, err |
| 489 | } |
| 490 | } |
| 491 | if query := nvq.withStorageFile; query != nil { |
| 492 | if err := nvq.loadStorageFile(ctx, query, nodes, nil, |
| 493 | func(n *NodeVersion, e *StorageFile) { n.Edges.StorageFile = e }); err != nil { |
| 494 | return nil, err |
| 495 | } |
| 496 | } |
| 497 | if query := nvq.withComfyNodes; query != nil { |
| 498 | if err := nvq.loadComfyNodes(ctx, query, nodes, |
| 499 | func(n *NodeVersion) { n.Edges.ComfyNodes = []*ComfyNode{} }, |
| 500 | func(n *NodeVersion, e *ComfyNode) { n.Edges.ComfyNodes = append(n.Edges.ComfyNodes, e) }); err != nil { |
| 501 | return nil, err |
| 502 | } |
| 503 | } |
| 504 | return nodes, nil |
nothing calls this directly
no test coverage detected