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

Method IDs

pkg/database/ent/mutation.go:8463–8476  ·  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

8461// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
8462// or updated by the mutation.
8463func (m *LockMutation) IDs(ctx context.Context) ([]int, error) {
8464 switch {
8465 case m.op.Is(OpUpdateOne | OpDeleteOne):
8466 id, exists := m.ID()
8467 if exists {
8468 return []int{id}, nil
8469 }
8470 fallthrough
8471 case m.op.Is(OpUpdate | OpDelete):
8472 return m.Client().Lock.Query().Where(m.predicates...).IDs(ctx)
8473 default:
8474 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
8475 }
8476}
8477
8478// SetName sets the "name" field.
8479func (m *LockMutation) SetName(s string) {

Callers 10

IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45
IDsMethod · 0.45

Calls 4

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

Tested by

no test coverage detected