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

Method IDs

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

10941// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
10942// or updated by the mutation.
10943func (m *SettingMutation) IDs(ctx context.Context) ([]int, error) {
10944 switch {
10945 case m.op.Is(OpUpdateOne | OpDeleteOne):
10946 id, exists := m.ID()
10947 if exists {
10948 return []int{id}, nil
10949 }
10950 fallthrough
10951 case m.op.Is(OpUpdate | OpDelete):
10952 return m.Client().Setting.Query().Where(m.predicates...).IDs(ctx)
10953 default:
10954 return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
10955 }
10956}
10957
10958// SetCreatedAt sets the "created_at" field.
10959func (m *SettingMutation) 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