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

Method sqlAll

ent/storagefile_query.go:338–368  ·  view source on GitHub ↗
(ctx context.Context, hooks ...queryHook)

Source from the content-addressed store, hash-verified

336}
337
338func (sfq *StorageFileQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*StorageFile, error) {
339 var (
340 nodes = []*StorageFile{}
341 withFKs = sfq.withFKs
342 _spec = sfq.querySpec()
343 )
344 if withFKs {
345 _spec.Node.Columns = append(_spec.Node.Columns, storagefile.ForeignKeys...)
346 }
347 _spec.ScanValues = func(columns []string) ([]any, error) {
348 return (*StorageFile).scanValues(nil, columns)
349 }
350 _spec.Assign = func(columns []string, values []any) error {
351 node := &StorageFile{config: sfq.config}
352 nodes = append(nodes, node)
353 return node.assignValues(columns, values)
354 }
355 if len(sfq.modifiers) > 0 {
356 _spec.Modifiers = sfq.modifiers
357 }
358 for i := range hooks {
359 hooks[i](ctx, _spec)
360 }
361 if err := sqlgraph.QueryNodes(ctx, sfq.driver, _spec); err != nil {
362 return nil, err
363 }
364 if len(nodes) == 0 {
365 return nodes, nil
366 }
367 return nodes, nil
368}
369
370func (sfq *StorageFileQuery) sqlCount(ctx context.Context) (int, error) {
371 _spec := sfq.querySpec()

Callers

nothing calls this directly

Calls 4

querySpecMethod · 0.95
assignValuesMethod · 0.95
scanValuesMethod · 0.45
QueryNodesMethod · 0.45

Tested by

no test coverage detected