MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / sqlAll

Method sqlAll

ent/setting_query.go:332–355  ·  view source on GitHub ↗
(ctx context.Context, hooks ...queryHook)

Source from the content-addressed store, hash-verified

330}
331
332func (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
357func (sq *SettingQuery) sqlCount(ctx context.Context) (int, error) {
358 _spec := sq.querySpec()

Callers

nothing calls this directly

Calls 3

querySpecMethod · 0.95
assignValuesMethod · 0.95
scanValuesMethod · 0.45

Tested by

no test coverage detected