(ctx context.Context, hooks ...queryHook)
| 330 | } |
| 331 | |
| 332 | func (sq *SettingQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Setting, error) { |
| 333 | var ( |
| 334 | nodes = []*Setting{} |
| 335 | _spec = sq.querySpec() |
| 336 | ) |
| 337 | _spec.ScanValues = func(columns []string) ([]any, error) { |
| 338 | return (*Setting).scanValues(nil, columns) |
| 339 | } |
| 340 | _spec.Assign = func(columns []string, values []any) error { |
| 341 | node := &Setting{config: sq.config} |
| 342 | nodes = append(nodes, node) |
| 343 | return node.assignValues(columns, values) |
| 344 | } |
| 345 | for i := range hooks { |
| 346 | hooks[i](ctx, _spec) |
| 347 | } |
| 348 | if err := sqlgraph.QueryNodes(ctx, sq.driver, _spec); err != nil { |
| 349 | return nil, err |
| 350 | } |
| 351 | if len(nodes) == 0 { |
| 352 | return nodes, nil |
| 353 | } |
| 354 | return nodes, nil |
| 355 | } |
| 356 | |
| 357 | func (sq *SettingQuery) sqlCount(ctx context.Context) (int, error) { |
| 358 | _spec := sq.querySpec() |
nothing calls this directly
no test coverage detected