MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / IDs

Method IDs

ent/metadata_query.go:204–213  ·  view source on GitHub ↗

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

(ctx context.Context)

Source from the content-addressed store, hash-verified

202
203// IDs executes the query and returns a list of Metadata IDs.
204func (mq *MetadataQuery) IDs(ctx context.Context) (ids []int, err error) {
205 if mq.ctx.Unique == nil && mq.path != nil {
206 mq.Unique(true)
207 }
208 ctx = setContextOp(ctx, mq.ctx, "IDs")
209 if err = mq.Select(metadata.FieldID).Scan(ctx, &ids); err != nil {
210 return nil, err
211 }
212 return ids, nil
213}
214
215// IDsX is like IDs, but panics if an error occurs.
216func (mq *MetadataQuery) 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