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

Method IDs

ent/mutation.go:4712–4725  ·  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

4710// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
4711// or updated by the mutation.
4712func (m *FsEventMutation) IDs(ctx context.Context) ([]int, error) {
4713 switch {
4714 case m.op.Is(OpUpdateOne | OpDeleteOne):
4715 id, exists := m.ID()
4716 if exists {
4717 return []int{id}, nil
4718 }
4719 fallthrough
4720 case m.op.Is(OpUpdate | OpDelete):
4721 return m.Client().FsEvent.Query().Where(m.predicates...).IDs(ctx)
4722 default:
4723 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
4724 }
4725}
4726
4727// SetCreatedAt sets the "created_at" field.
4728func (m *FsEventMutation) 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