MCPcopy Create free account
hub / github.com/Comfy-Org/registry-backend / sqlScan

Method sqlScan

ent/gitcommit_query.go:585–610  ·  view source on GitHub ↗
(ctx context.Context, root *GitCommitQuery, v any)

Source from the content-addressed store, hash-verified

583}
584
585func (gcgb *GitCommitGroupBy) sqlScan(ctx context.Context, root *GitCommitQuery, v any) error {
586 selector := root.sqlQuery(ctx).Select()
587 aggregation := make([]string, 0, len(gcgb.fns))
588 for _, fn := range gcgb.fns {
589 aggregation = append(aggregation, fn(selector))
590 }
591 if len(selector.SelectedColumns()) == 0 {
592 columns := make([]string, 0, len(*gcgb.flds)+len(gcgb.fns))
593 for _, f := range *gcgb.flds {
594 columns = append(columns, selector.C(f))
595 }
596 columns = append(columns, aggregation...)
597 selector.Select(columns...)
598 }
599 selector.GroupBy(selector.Columns(*gcgb.flds...)...)
600 if err := selector.Err(); err != nil {
601 return err
602 }
603 rows := &sql.Rows{}
604 query, args := selector.Query()
605 if err := gcgb.build.driver.Query(ctx, query, args, rows); err != nil {
606 return err
607 }
608 defer rows.Close()
609 return sql.ScanSlice(rows, v)
610}
611
612// GitCommitSelect is the builder for selecting fields of GitCommit entities.
613type GitCommitSelect struct {

Callers

nothing calls this directly

Calls 5

SelectMethod · 0.45
sqlQueryMethod · 0.45
GroupByMethod · 0.45
QueryMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected