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

Method sqlScan

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

Source from the content-addressed store, hash-verified

631}
632
633func (gcs *GitCommitSelect) sqlScan(ctx context.Context, root *GitCommitQuery, v any) error {
634 selector := root.sqlQuery(ctx)
635 aggregation := make([]string, 0, len(gcs.fns))
636 for _, fn := range gcs.fns {
637 aggregation = append(aggregation, fn(selector))
638 }
639 switch n := len(*gcs.selector.flds); {
640 case n == 0 && len(aggregation) > 0:
641 selector.Select(aggregation...)
642 case n != 0 && len(aggregation) > 0:
643 selector.AppendSelect(aggregation...)
644 }
645 rows := &sql.Rows{}
646 query, args := selector.Query()
647 if err := gcs.driver.Query(ctx, query, args, rows); err != nil {
648 return err
649 }
650 defer rows.Close()
651 return sql.ScanSlice(rows, v)
652}
653
654// Modify adds a query modifier for attaching custom logic to queries.
655func (gcs *GitCommitSelect) Modify(modifiers ...func(s *sql.Selector)) *GitCommitSelect {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected