(ctx context.Context, hooks ...queryHook)
| 372 | } |
| 373 | |
| 374 | func (gcq *GitCommitQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*GitCommit, error) { |
| 375 | var ( |
| 376 | nodes = []*GitCommit{} |
| 377 | _spec = gcq.querySpec() |
| 378 | loadedTypes = [1]bool{ |
| 379 | gcq.withResults != nil, |
| 380 | } |
| 381 | ) |
| 382 | _spec.ScanValues = func(columns []string) ([]any, error) { |
| 383 | return (*GitCommit).scanValues(nil, columns) |
| 384 | } |
| 385 | _spec.Assign = func(columns []string, values []any) error { |
| 386 | node := &GitCommit{config: gcq.config} |
| 387 | nodes = append(nodes, node) |
| 388 | node.Edges.loadedTypes = loadedTypes |
| 389 | return node.assignValues(columns, values) |
| 390 | } |
| 391 | if len(gcq.modifiers) > 0 { |
| 392 | _spec.Modifiers = gcq.modifiers |
| 393 | } |
| 394 | for i := range hooks { |
| 395 | hooks[i](ctx, _spec) |
| 396 | } |
| 397 | if err := sqlgraph.QueryNodes(ctx, gcq.driver, _spec); err != nil { |
| 398 | return nil, err |
| 399 | } |
| 400 | if len(nodes) == 0 { |
| 401 | return nodes, nil |
| 402 | } |
| 403 | if query := gcq.withResults; query != nil { |
| 404 | if err := gcq.loadResults(ctx, query, nodes, |
| 405 | func(n *GitCommit) { n.Edges.Results = []*CIWorkflowResult{} }, |
| 406 | func(n *GitCommit, e *CIWorkflowResult) { n.Edges.Results = append(n.Edges.Results, e) }); err != nil { |
| 407 | return nil, err |
| 408 | } |
| 409 | } |
| 410 | return nodes, nil |
| 411 | } |
| 412 | |
| 413 | func (gcq *GitCommitQuery) loadResults(ctx context.Context, query *CIWorkflowResultQuery, nodes []*GitCommit, init func(*GitCommit), assign func(*GitCommit, *CIWorkflowResult)) error { |
| 414 | fks := make([]driver.Value, 0, len(nodes)) |
nothing calls this directly
no test coverage detected