MCPcopy
hub / github.com/crowdsecurity/crowdsec / IDs

Method IDs

pkg/database/ent/meta_query.go:205–214  ·  view source on GitHub ↗

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

(ctx context.Context)

Source from the content-addressed store, hash-verified

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