MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / IDs

Method IDs

pkg/database/ent/mutation.go:7833–7846  ·  view source on GitHub ↗

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

(ctx context.Context)

Source from the content-addressed store, hash-verified

7831// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
7832// or updated by the mutation.
7833func (m *EventMutation) IDs(ctx context.Context) ([]int, error) {
7834 switch {
7835 case m.op.Is(OpUpdateOne | OpDeleteOne):
7836 id, exists := m.ID()
7837 if exists {
7838 return []int{id}, nil
7839 }
7840 fallthrough
7841 case m.op.Is(OpUpdate | OpDelete):
7842 return m.Client().Event.Query().Where(m.predicates...).IDs(ctx)
7843 default:
7844 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
7845 }
7846}
7847
7848// SetCreatedAt sets the "created_at" field.
7849func (m *EventMutation) SetCreatedAt(t time.Time) {

Callers

nothing calls this directly

Calls 5

IDMethod · 0.95
ClientMethod · 0.95
IDsMethod · 0.45
WhereMethod · 0.45
QueryMethod · 0.45

Tested by

no test coverage detected