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

Method IDs

ent/entity_query.go:253–262  ·  view source on GitHub ↗

IDs executes the query and returns a list of Entity IDs.

(ctx context.Context)

Source from the content-addressed store, hash-verified

251
252// IDs executes the query and returns a list of Entity IDs.
253func (eq *EntityQuery) IDs(ctx context.Context) (ids []int, err error) {
254 if eq.ctx.Unique == nil && eq.path != nil {
255 eq.Unique(true)
256 }
257 ctx = setContextOp(ctx, eq.ctx, "IDs")
258 if err = eq.Select(entity.FieldID).Scan(ctx, &ids); err != nil {
259 return nil, err
260 }
261 return ids, nil
262}
263
264// IDsX is like IDs, but panics if an error occurs.
265func (eq *EntityQuery) IDsX(ctx context.Context) []int {

Callers 3

IDsXMethod · 0.95
FirstIDMethod · 0.45
OnlyIDMethod · 0.45

Calls 4

UniqueMethod · 0.95
SelectMethod · 0.95
setContextOpFunction · 0.85
ScanMethod · 0.45

Tested by

no test coverage detected