(ctx context.Context, hooks ...queryHook)
| 336 | } |
| 337 | |
| 338 | func (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 | |
| 370 | func (sfq *StorageFileQuery) sqlCount(ctx context.Context) (int, error) { |
| 371 | _spec := sfq.querySpec() |
nothing calls this directly
no test coverage detected